Java Doc for ModifiableMetadata.java in  » GIS » GeoTools-2.4.1 » org » geotools » metadata » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.metadata 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.metadata.AbstractMetadata
      org.geotools.metadata.ModifiableMetadata

All known Subclasses:   org.geotools.metadata.iso.MetadataEntity,
ModifiableMetadata
abstract public class ModifiableMetadata extends AbstractMetadata implements Cloneable(Code)
Base class for metadata that may (or may not) be modifiable. Implementations will typically provide set*(...) methods for each corresponding get*() method. An initially modifiable metadata may become unmodifiable at a later stage (typically after its construction is completed) by the call to the ModifiableMetadata.freeze method.

Subclasses should follow the pattern below for every get and set methods, with a special processing for :

 private Foo property;
 public Foo getProperty() {
 return property;
 }
 public synchronized void setProperty(Foo newValue) {
 ;
 property = newValue;
 }
 
For collections (note that the call to ModifiableMetadata.checkWritePermission() is implicit):
 private Collection<Foo> properties;
 public synchronized Collection<Foo> getProperties() {
 return properties = 
 (properties, Foo.class);
 }
 public synchronized void setProperties(Collection<Foo> newValues) {
 properties = 
 (newValues, properties, Foo.class);
 }
 

since:
   2.4
version:
   $Id: ModifiableMetadata.java 27848 2007-11-12 13:10:32Z desruisseaux $
author:
   Martin Desruisseaux



Constructor Summary
protected  ModifiableMetadata()
     Constructs an initially empty metadata.
protected  ModifiableMetadata(Object source)
     Constructs a metadata entity initialized with the values from the specified metadata.

Method Summary
protected  voidcheckWritePermission()
     Checks if changes in the metadata are allowed.
protected  Objectclone()
     Returns a shallow copy of this metadata.

While , this class do not provides the clone() operation as part of the public API.

final protected  CollectioncopyCollection(Collection source, Collection target, Class elementType)
     Copies the content of one collection ( source ) into an other ( target ). If the target collection is null , or if its type ( List vs Set ) doesn't matches the type of the source collection, a new target collection is expected.

A call to ModifiableMetadata.checkWritePermission is implicit before the copy is performed.
Parameters:
  source - The source collection.

public synchronized  voidfreeze()
     Declares this metadata and all its attributes as unmodifiable.
final  voidinvalidate()
     Invoked when the metadata changed.
final public  booleanisModifiable()
     Returns true if this metadata is modifiable.
final protected  CollectionnonNullCollection(Collection c, Class elementType)
     Returns the specified collection, or a new one if c is null. This is a convenience method for implementation of getFoo() methods.
Parameters:
  c - The collection to checks.
Parameters:
  elementType - The element type (used only if c is null).
final protected  ListnonNullList(List c, Class elementType)
     Returns the specified list, or a new one if c is null. This is a convenience method for implementation of getFoo() methods.
Parameters:
  c - The list to checks.
Parameters:
  elementType - The element type (used only if c is null).
public synchronized  AbstractMetadataunmodifiable()
     Returns an unmodifiable copy of this metadata.
static  Objectunmodifiable(Object object)
     Returns an unmodifiable copy of the specified object.


Constructor Detail
ModifiableMetadata
protected ModifiableMetadata()(Code)
Constructs an initially empty metadata.



ModifiableMetadata
protected ModifiableMetadata(Object source) throws ClassCastException, UnmodifiableMetadataException(Code)
Constructs a metadata entity initialized with the values from the specified metadata. This constructor behavior is as in .
Parameters:
  source - The metadata to copy values from.
throws:
  ClassCastException - if the specified metadata don't implements the expectedmetadata interface.
throws:
  UnmodifiableMetadataException - if this class don't define set methodscorresponding to the get methods found in the implemented interface,or if this instance is not modifiable for some other reason.




Method Detail
checkWritePermission
protected void checkWritePermission() throws UnmodifiableMetadataException(Code)
Checks if changes in the metadata are allowed. All setFoo(...) methods in subclasses should invoke this method (directly or indirectly) before to apply any change.
throws:
  UnmodifiableMetadataException - if this metadata is unmodifiable.



clone
protected Object clone() throws CloneNotSupportedException(Code)
Returns a shallow copy of this metadata.

While , this class do not provides the clone() operation as part of the public API. The clone operation is required for the internal working of the ModifiableMetadata.unmodifiable() method, which expect from clone() a shallow copy of this metadata entity. The default implementation of Object.clone is suffisient for most use. A shallow copy of this metadata.
throws:
  CloneNotSupportedException - if the clone is not supported.




copyCollection
final protected Collection copyCollection(Collection source, Collection target, Class elementType) throws UnmodifiableMetadataException(Code)
Copies the content of one collection ( source ) into an other ( target ). If the target collection is null , or if its type ( List vs Set ) doesn't matches the type of the source collection, a new target collection is expected.

A call to ModifiableMetadata.checkWritePermission is implicit before the copy is performed.
Parameters:
  source - The source collection. null is synonymous to empty.
Parameters:
  target - The target collection, or null if not yet created.
Parameters:
  elementType - The base type of elements to put in the collection. target , or a newly created collection.
throws:
  UnmodifiableMetadataException - if this metadata is unmodifiable.




freeze
public synchronized void freeze()(Code)
Declares this metadata and all its attributes as unmodifiable. This method is invoked automatically by the ModifiableMetadata.unmodifiable() method. Subclasses usually don't need to override it since the default implementation performs its work using Java reflection.



invalidate
final void invalidate()(Code)
Invoked when the metadata changed. Some cached informations will need to be recomputed.



isModifiable
final public boolean isModifiable()(Code)
Returns true if this metadata is modifiable. This method returns false if ModifiableMetadata.freeze() has been invoked on this object.



nonNullCollection
final protected Collection nonNullCollection(Collection c, Class elementType)(Code)
Returns the specified collection, or a new one if c is null. This is a convenience method for implementation of getFoo() methods.
Parameters:
  c - The collection to checks.
Parameters:
  elementType - The element type (used only if c is null). c , or a new collection if c is null.



nonNullList
final protected List nonNullList(List c, Class elementType)(Code)
Returns the specified list, or a new one if c is null. This is a convenience method for implementation of getFoo() methods.
Parameters:
  c - The list to checks.
Parameters:
  elementType - The element type (used only if c is null). c , or a new list if c is null.



unmodifiable
public synchronized AbstractMetadata unmodifiable()(Code)
Returns an unmodifiable copy of this metadata. Any attempt to modify an attribute of the returned object will throw an UnmodifiableMetadataException . If this metadata is already unmodifiable, then this method returns this .

The default implementation this metadata and the clone before to return it. An unmodifiable copy of this metadata.




unmodifiable
static Object unmodifiable(Object object)(Code)
Returns an unmodifiable copy of the specified object. This method performs the following heuristic tests:

  • If the specified object is an instance of ModifiableMetadata , then ModifiableMetadata.unmodifiable() is invoked on this object.
  • Otherwise, if the object is a , then the content is copied into a new collection of similar type, with values replaced by their unmodifiable variant.
  • Otherwise, if the object implements the org.opengis.util.Cloneable interface, then a clone is returned.
  • Otherwise, the object is assumed immutable and returned unchanged.

Parameters:
  object - The object to convert in an immutable one. A presumed immutable view of the specified object.



Fields inherited from org.geotools.metadata.AbstractMetadata
final protected static Logger LOGGER(Code)(Java Doc)

Methods inherited from org.geotools.metadata.AbstractMetadata
public synchronized Map asMap()(Code)(Java Doc)
public synchronized TreeModel asTree()(Code)(Java Doc)
public synchronized boolean equals(Object object)(Code)(Java Doc)
public Class getInterface()(Code)(Java Doc)
abstract public MetadataStandard getStandard()(Code)(Java Doc)
public synchronized int hashCode()(Code)(Java Doc)
void invalidate()(Code)(Java Doc)
boolean isModifiable()(Code)(Java Doc)
public synchronized String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.