Package org.apache.sis.internal.metadata
Class NameMeaning
java.lang.Object
org.apache.sis.util.Static
org.apache.sis.internal.metadata.NameMeaning
The meaning of some parts of URN in the
"ogc"
namespace.
The meaning are defined by OGC Naming Authority (OGCNA) or other OGC sources.- Since:
- 0.5
- Version:
- 0.8
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
Adds the given authority to theAUTHORITIES
map.static String
getVersion
(org.opengis.metadata.citation.Citation authority) Returns the version of the namespace managed by the given authority.static String
toObjectType
(Class<?> type) Returns the "object type" part of an OGC URN for the given class, ornull
if unknown.static String
Formats the given identifier using the"ogc:urn:def:"
syntax with possible heuristic changes to the given values.
-
Field Details
-
CLASSES
Subtypes ofIdentifiedObject
for which an object type is defined. For each interface at index i, the type isTYPES[i]
.For performance reasons, most frequently used types should be first.
-
TYPES
The object types for instances ofCLASSES
. SeeDefinitionURI
javadoc for a list of object types in URN.Types not yet listed (waiting to see if there is a use for them):
"group" for ParameterValueGroup.class; "verticalDatumType" for VerticalDatumType.class; "pixelInCell" for PixelInCell.class; "rangeMeaning" for RangeMeaning.class; "axisDirection" for AxisDirection.class; -
AUTHORITIES
Naming authorities allowed to appear in"urn:ogc:def:"
. This map serves two purposes:- Tell if a given authority is one of the authorities allowed by the OGC namespace.
- Opportunistically fix the letter case.
MultiAuthoritiesFactory
for its keys.- Since:
- 0.7
- See Also:
-
-
Constructor Details
-
NameMeaning
private NameMeaning()Do not allow instantiation of this class.
-
-
Method Details
-
add
Adds the given authority to theAUTHORITIES
map. This method shall be invoked at class initialization time only. -
toURN
Formats the given identifier using the"ogc:urn:def:"
syntax with possible heuristic changes to the given values. The identifier code space, version and code are appended omitting any characters that are not valid for a Unicode identifier. If some information are missing in the given identifier, then this method returnsnull
. This method tries to "fix" the given values using some heuristic knowledge about the meaning of URN.- Parameters:
type
- the object type.authority
- the authority as one of the values documented inDefinitionURI
javadoc.version
- the code version, ornull
. This is the only optional information.code
- the code.- Returns:
- an identifier using the URN syntax, or
null
if a mandatory information is missing. - Since:
- 0.7
-
toObjectType
Returns the "object type" part of an OGC URN for the given class, ornull
if unknown. SeeDefinitionURI
javadoc for a list of object types in URN.- Parameters:
type
- the class for which to get the URN type.- Returns:
- the URN type, or
null
if unknown.
-
getVersion
Returns the version of the namespace managed by the given authority. Current Apache SIS implementation searches this information in theCitation.getEdition()
property. This approach is based on the assumption that the authority is some specification document or reference to a database, not an organization. However, this policy may be revisited in any future SIS version.- Parameters:
authority
- the authority from which to get a version, ornull
.- Returns:
- the version, or
null
if none. - Since:
- 0.7
-