Package org.apache.sis.metadata
Class StandardImplementation
java.lang.Object
org.apache.sis.metadata.MetadataStandard
org.apache.sis.metadata.StandardImplementation
- All Implemented Interfaces:
Serializable
Information about an Apache SIS metadata standard implementation.
- Since:
- 0.3
- Version:
- 0.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String[]
The acronyms that implementation classes may have, ornull
if none.private static final String[]
The prefixes that implementation classes may have.private final String
The root packages for metadata implementations, ornull
if none.Implementations for a given interface, computed when first needed then cached.private static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.metadata.MetadataStandard
citation, IMPLEMENTATION_CAN_ALTER_API, INSTANCES, interfacePackage, ISO_19111, ISO_19115, ISO_19123, ISO_19157
-
Constructor Summary
ConstructorsConstructorDescriptionStandardImplementation
(String citation, String interfacePackage, String implementationPackage, String[] acronyms, MetadataStandard... dependencies) Creates a new instance working on implementation of interfaces defined in the specified package. -
Method Summary
Modifier and TypeMethodDescription<T> Class
<? extends T> getImplementation
(Class<T> type) Returns the implementation class for the given interface, ornull
if none.(package private) boolean
isPendingAPI
(Class<?> type) Accepts Apache SIS implementation classes as "pseudo-interfaces" if they are annotated withUML
.(package private) Object
Invoked on deserialization.Methods inherited from class org.apache.sis.metadata.MetadataStandard
asIndexMap, asInformationMap, asNameMap, asTreeTable, asTypeMap, asValueMap, clearCache, equals, forClass, getAccessor, getCitation, getInterface, getInterface, getTitle, hashCode, isMetadata, isSupported, setMapForField, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
implementationPackage
The root packages for metadata implementations, ornull
if none. If non-null, then this string must ends with a trailing"."
. -
IMPL_PREFIXES
The prefixes that implementation classes may have. The most common prefixes should be first, because the prefixes will be tried in that order. -
acronyms
The acronyms that implementation classes may have, ornull
if none. If non-null, then this array shall contain (full text, acronym) pairs. The full text shall appear to the end of the class name, otherwise it is not replaced. This is necessary in order to avoid the replacement of"DefaultCoordinateSystemAxis"
by"DefaultCSAxis"
. -
implementations
Implementations for a given interface, computed when first needed then cached.Implementation note: In the particular case ofClass
keys,IdentityHashMap
andHashMap
have identical behavior sinceClass
is final and does not override theequals(Object)
andhashCode()
methods. TheIdentityHashMap
Javadoc claims that it is faster than the regularHashMap
. But maybe the most interesting property is that it allocates less objects sinceIdentityHashMap
implementation doesn't need the chain of objects created byHashMap
.
-
-
Constructor Details
-
StandardImplementation
StandardImplementation(String citation, String interfacePackage, String implementationPackage, String[] acronyms, MetadataStandard... dependencies) Creates a new instance working on implementation of interfaces defined in the specified package. This constructor is used only for the predefined constants.- Parameters:
citation
- the title of the standard.interfacePackage
- the root package for metadata interfaces, with a trailing'.'
.implementationPackage
- the root package for metadata implementations. with a trailing'.'
.acronyms
- an array of (full text, acronyms) pairs. This array is not cloned.dependencies
- the dependencies to other metadata standards, ornull
if none.
-
-
Method Details
-
isPendingAPI
Accepts Apache SIS implementation classes as "pseudo-interfaces" if they are annotated withUML
. We use this feature for example in the transition from ISO 19115:2003 to ISO 19115:2014, when new API is defined in Apache SIS but not yet available in GeoAPI interfaces.- Overrides:
isPendingAPI
in classMetadataStandard
-
getImplementation
Returns the implementation class for the given interface, ornull
if none. This class uses heuristic rules based on naming conventions.- Overrides:
getImplementation
in classMetadataStandard
- Type Parameters:
T
- the compile-timetype
.- Parameters:
type
- the interface, typically from theorg.opengis.metadata
package.- Returns:
- the implementation class, or
null
if none.
-
readResolve
Invoked on deserialization. Returns one of the preexisting constants if possible.- Throws:
ObjectStreamException
-