|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.metadata.MetadataStandard
public final class MetadataStandard
Enumeration of some metadata standards. A standard is defined by a set of Java interfaces
in a specific package or subpackages. For example the ISO 19115
standard is defined by GeoAPI interfaces in
the org.opengis.metadata
package and subpackages.
This class provides some methods operating on metadata instances through Java reflection. The following rules are assumed:
get*()
(arbitrary return type) or is*()
(boolean return type) methods found
in the interface. Getters declared in the implementation
only are ignored.set*(...)
method is defined
in the implementation class for the corresponding get*()
method. The
setter don't need to be defined in the interface.
Field Summary | |
---|---|
static MetadataStandard |
ISO_19111
An instance working on ISO 19111 standard as defined by GeoAPI interfaces in the org.opengis.referencing package and subpackages. |
static MetadataStandard |
ISO_19115
An instance working on ISO 19115 standard as defined by GeoAPI interfaces in the org.opengis.metadata package and subpackages. |
static MetadataStandard |
ISO_19119
An instance working on ISO 19119 standard as defined by GeoAPI interfaces in the org.opengis.service package and subpackages. |
Constructor Summary | |
---|---|
MetadataStandard(java.lang.String interfacePackage)
Creates a new instance working on implementation of interfaces defined in the specified package. |
Method Summary | |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
asMap(java.lang.Object metadata)
Returns a view of the specified metadata object as a map. |
javax.swing.tree.TreeModel |
asTree(java.lang.Object metadata)
Returns a view of the specified metadata as a tree. |
java.lang.Class<?> |
getInterface(java.lang.Class<?> implementation)
Returns the metadata interface implemented by the specified implementation class. |
int |
hashCode(java.lang.Object metadata)
Computes a hash code for the specified metadata. |
void |
shallowCopy(java.lang.Object source,
java.lang.Object target,
boolean skipNulls)
Copies all metadata from source to target. |
boolean |
shallowEquals(java.lang.Object metadata1,
java.lang.Object metadata2,
boolean skipNulls)
Compares the two specified metadata objects. |
java.lang.String |
toString(java.lang.Object metadata)
Returns a string representation of the specified metadata. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final MetadataStandard ISO_19111
org.opengis.referencing
package and subpackages.
public static final MetadataStandard ISO_19115
org.opengis.metadata
package and subpackages.
public static final MetadataStandard ISO_19119
org.opengis.service
package and subpackages.
Constructor Detail |
---|
public MetadataStandard(java.lang.String interfacePackage)
org.opengis.metadata
package.
interfacePackage
- The root package for metadata interfaces.Method Detail |
---|
public java.lang.Class<?> getInterface(java.lang.Class<?> implementation) throws java.lang.ClassCastException
implementation
- The implementation class.
java.lang.ClassCastException
- if the specified implementation class do
not implements a metadata interface of the expected package.AbstractMap#getInterface
public java.util.Map<java.lang.String,java.lang.Object> asMap(java.lang.Object metadata) throws java.lang.ClassCastException
get*()
methods declared in the metadata interface.
The map supports the put
operations if the underlying
metadata object contains #set*(...)
methods.
metadata
- The metadata object to view as a map.
java.lang.ClassCastException
- if at the metadata object don't
implements a metadata interface of the expected package.AbstractMap#asMap
public javax.swing.tree.TreeModel asTree(java.lang.Object metadata) throws java.lang.ClassCastException
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.
metadata
- The metadata object to formats as a string.
java.lang.ClassCastException
- if at the metadata object don't
implements a metadata interface of the expected package.AbstractMap#asTree
public void shallowCopy(java.lang.Object source, java.lang.Object target, boolean skipNulls) throws java.lang.ClassCastException, UnmodifiableMetadataException
source
- The metadata to copy.target
- The target metadata.skipNulls
- If true
, only non-null values will be copied.
java.lang.ClassCastException
- if the source or target object don't
implements a metadata interface of the expected package.
UnmodifiableMetadataException
- if the target metadata is unmodifiable,
or if at least one setter method was required but not found.AbstractMap#AbstractMap(Object)
public boolean shallowEquals(java.lang.Object metadata1, java.lang.Object metadata2, boolean skipNulls) throws java.lang.ClassCastException
Object.equals(java.lang.Object)
method without
recursive call to this shallowEquals(...)
method for child metadata.
This method can optionaly excludes null values from the comparaison. In metadata, null value often means "don't know", so in some occasion we want to consider two metadata as different only if an attribute value is know for sure to be different.
The first arguments must be an implementation of a metadata interface, otherwise an exception will be thrown. The two argument do not need to be the same implementation however.
metadata1
- The first metadata object to compare.metadata2
- The second metadata object to compare.skipNulls
- If true
, only non-null values will be compared.
true
if the given metadata objects are equals.
java.lang.ClassCastException
- if at least one metadata object don't
implements a metadata interface of the expected package.AbstractMetadata.equals(java.lang.Object)
public int hashCode(java.lang.Object metadata) throws java.lang.ClassCastException
Set.hashCode()
and ensure that the hash code value is insensitive
to the ordering of properties.
metadata
- The metadata object to compute hash code.
java.lang.ClassCastException
- if at the metadata object don't
implements a metadata interface of the expected package.AbstractMap#hashCode
public java.lang.String toString(java.lang.Object metadata) throws java.lang.ClassCastException
metadata
- The metadata object to formats as a string.
java.lang.ClassCastException
- if at the metadata object don't
implements a metadata interface of the expected package.AbstractMap#toString
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |