| |
|
| java.lang.Object org.geotools.metadata.AbstractMetadata
All known Subclasses: org.geotools.metadata.ModifiableMetadata,
AbstractMetadata | abstract public class AbstractMetadata (Code) | | Base class for metadata implementations. Subclasses must implement the interfaces
of some
. This class uses
in order to provide default
implementation of
,
AbstractMetadata.equals and
AbstractMetadata.hashCode methods.
since: 2.4 version: $Id: AbstractMetadata.java 27862 2007-11-12 19:51:19Z desruisseaux $ author: Martin Desruisseaux (Geomatys) |
Field Summary | |
final protected static Logger | LOGGER The logger for metadata implementation. |
Constructor Summary | |
protected | AbstractMetadata() Creates an initially empty metadata. | protected | AbstractMetadata(Object source) Constructs a metadata entity initialized with the values from the specified metadata.
The
source metadata must implements the same metadata interface (defined by
the
) than this class, but don't need to be the same
implementation class. |
Method Summary | |
public synchronized Map | asMap() Returns a view of this metadata object as a
. | public synchronized TreeModel | asTree() Returns a view of this metadata as a tree. | public synchronized boolean | equals(Object object) Compares this metadata with the specified object for equality. | public Class | getInterface() Returns the metadata interface implemented by this class. | abstract public MetadataStandard | getStandard() Returns the metadata standard implemented by subclasses. | public synchronized int | hashCode() Computes a hash code value for this metadata using Java reflection. | void | invalidate() Invoked when the metadata changed. | boolean | isModifiable() Returns
true if this metadata is modifiable. | public synchronized String | toString() Returns a string representation of this metadata. |
LOGGER | final protected static Logger LOGGER(Code) | | The logger for metadata implementation.
|
AbstractMetadata | protected AbstractMetadata()(Code) | | Creates an initially empty metadata.
|
AbstractMetadata | protected AbstractMetadata(Object source) throws ClassCastException, UnmodifiableMetadataException(Code) | | Constructs a metadata entity initialized with the values from the specified metadata.
The
source metadata must implements the same metadata interface (defined by
the
) than this class, but don't need to be the same
implementation class. The copy is performed using Java reflections.
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. |
asMap | public synchronized Map asMap()(Code) | | Returns a view of this metadata object as a
. The map is backed by this
metadata object using Java reflection, so changes in the underlying metadata object are
immediately reflected in the map. The keys are the property names as determined by the list
of
get*() methods declared in the
.
The map supports the
Map.put put operations if the underlying
metadata object contains
#set*(...) methods.
|
asTree | public synchronized TreeModel asTree()(Code) | | Returns a view of this metadata as a tree. Note that while
TreeModel is
defined in the
javax.swing.tree package, it can be seen as a data structure
independent of Swing. It will not force class loading of Swing framework.
In current implementation, the tree is not live (i.e. changes in metadata are not
reflected in the tree). However it may be improved in a future Geotools implementation.
|
equals | public synchronized boolean equals(Object object)(Code) | | Compares this metadata with the specified object for equality. The default
implementation uses Java reflection. Subclasses may override this method
for better performances.
This method performs a deep comparaison (i.e. if this metadata contains
other metadata, the comparaison will walk through the other metadata content as well)
providing that every childs implement the
Object.equals method as well. This
is the case by default if every childs are subclasses of
AbstractMetadata .
|
getInterface | public Class getInterface()(Code) | | Returns the metadata interface implemented by this class. It should be one of the
interfaces defined in the
implemented
by this class.
|
getStandard | abstract public MetadataStandard getStandard()(Code) | | Returns the metadata standard implemented by subclasses.
|
hashCode | public synchronized int hashCode()(Code) | | Computes a hash code value for this metadata using Java reflection. The hash code
is defined as the sum of hash code values of all non-null properties. This is the
same contract than
java.util.Set.hashCode and ensure that the hash code
value is insensitive to the ordering of properties.
|
invalidate | void invalidate()(Code) | | Invoked when the metadata changed. Some cached informations will need
to be recomputed.
|
isModifiable | boolean isModifiable()(Code) | | Returns
true if this metadata is modifiable. The default implementation
uses heuristic rules which return
false if and only if:
- this class do not contains any
set*(...) method
- All
get*() methods return a presumed immutable object.
The maining of "presumed immutable" may vary in
different Geotools versions.
Otherwise, this method conservatively returns
true . Subclasses
should override this method if they can provide a more rigorous analysis.
|
toString | public synchronized String toString()(Code) | | Returns a string representation of this metadata.
|
|
|
|