|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectAbstractMetadata
public abstract class AbstractMetadata
Base class for metadata implementations. Subclasses must implement the interfaces
of some metadata standard. This class uses
Java reflection in order to provide default
implementation of copy constructor,
equals(java.lang.Object)
and hashCode
methods.
Field Summary | |
---|---|
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. |
Method Summary | |
---|---|
Map<String,Object> |
asMap()
Returns a view of this metadata object as a map. |
TreeModel |
asTree()
Returns a view of this metadata as a tree. |
boolean |
equals(Object object)
Compares this metadata with the specified object for equality. |
Class<?> |
getInterface()
Returns the metadata interface implemented by this class. |
abstract MetadataStandard |
getStandard()
Returns the metadata standard implemented by subclasses. |
int |
hashCode()
Computes a hash code value for this metadata using Java reflection. |
String |
toString()
Returns a string representation of this metadata. |
Methods inherited from class Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final Logger LOGGER
Constructor Detail |
---|
protected AbstractMetadata()
protected AbstractMetadata(Object source) throws ClassCastException, UnmodifiableMetadataException
source
metadata must implements the same metadata interface (defined by
the standard) than this class, but don't need to be the same
implementation class. The copy is performed using Java reflections.
source
- The metadata to copy values from.
ClassCastException
- if the specified metadata don't implements the expected
metadata interface.
UnmodifiableMetadataException
- if this class don't define set
methods
corresponding to the get
methods found in the implemented interface,
or if this instance is not modifiable for some other reason.Method Detail |
---|
public abstract MetadataStandard getStandard()
public Class<?> getInterface()
public Map<String,Object> asMap()
get*()
methods declared in the metadata interface.
The map supports the put
operations if the underlying
metadata object contains #set*(...)
methods.
public TreeModel asTree()
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.
public boolean equals(Object object)
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(java.lang.Object)
method as well. This
is the case by default if every childs are subclasses of AbstractMetadata
.
equals
in class Object
object
- The object to compare with this metadata.
true
if the given object is equals to this metadata.public int hashCode()
Set.hashCode()
and ensure that the hash code
value is insensitive to the ordering of properties.
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |