Package org.apache.sis.internal.jaxb.cat
Class CodeListUID
java.lang.Object
org.apache.sis.internal.jaxb.cat.CodeListUID
Stores information about
CodeList
in order to marshal in the way defined by ISO 19115-3.
This class provides the codeList
and codeListValue
attributes to be marshalled.
Those attributes should be unique for each code.
"UID" in the class name stands for "Unique Identifier".
This object is wrapped by CodeListAdapter
or, in the special case of Locale
type, by
LanguageCode
or Country
.
Base URLs
This class defines constants for URL to schema directories or definition files used in code list elements. SIS does not use those URL directly for downloading files (downloading an XML schema from ISO servers require"https"
protocol, but the URLs in this class use "http"
for historical reasons).
Example:
Constants in this class are organized in three groups:
- Constants with the
_ROOT
suffix are"http://"
URL to a root directory. - Constants with the
_PATH
suffix are relative paths to concatenate to a_ROOT
constant in order to get the full path to a file. - Constants with the
_XSD
suffix are"http://"
URL to a the XSD definition file.
Note on multi-lingual files
Some files are available in two variants: with and without"ML_"
prefix, which stands for "Multi Lingual".
Some examples are "[ML_]gmxCodelists.xml"
and "[ML_]gmxUom.xml"
. The following assumptions hold:
- All code lists defined in a
ML_foo.xml
file exist also infoo.xml
. - The converse of above point is not necessarily true:
the
ML_foo.xml
file may contain only a subset offoo.xml
. - All English descriptions in
ML_foo.xml
file are strictly identical to the ones infoo.xml
. - Descriptions in other languages than English exist only in
ML_foo.xml
.
- Since:
- 0.3
- Version:
- 1.1
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThecodeList
attribute in the XML element.static final String
The string to append toMETADATA_ROOT
for obtaining the path to the definitions of code lists.static final String
The string to append toMETADATA_ROOT_LEGACY
or one of its alternative for obtaining the path to the definitions of code lists.ThecodeListValue
attribute in the XML element.The optionalcodeSpace
attribute in the XML element.static final String
The namespace root of ISO 19115 objects.static final String
The root directory of OGC metadata schemas.static final String
The string to append toMETADATA_ROOT
or one of its alternative for obtaining the path to the definitions of units of measurement.The optional value to write in the XML element. -
Constructor Summary
ConstructorsConstructorDescriptionDefault empty constructor for JAXB.Builds a code list with the given attributes.CodeListUID
(Context context, org.opengis.util.CodeList<?> code) Builds a value forCodeListAdapter
elements. -
Method Summary
-
Field Details
-
METADATA_ROOT
The namespace root of ISO 19115 objects. This is the namespace used by default in Apache SIS.Historical note
The XSD files can be downloaded from that URL as well, but we sometimes experiment unexpected end of file. The same files can be downloaded from ISO/TC 211 repository, which seems more stable. The TC 211 repository is used for downloads, while the standard ISO URL is sill used for namespaces.- See Also:
-
METADATA_ROOT_LEGACY
The root directory of OGC metadata schemas. This is the schema used by default in Apache SIS. Some alternatives to this URL are:- http://schemas.opengis.net/iso/19139/20070417/
- http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/
- See Also:
-
CODELISTS_PATH
The string to append toMETADATA_ROOT
for obtaining the path to the definitions of code lists.- See Also:
-
CODELISTS_PATH_LEGACY
The string to append toMETADATA_ROOT_LEGACY
or one of its alternative for obtaining the path to the definitions of code lists.A localized version of this file exists also with the
"ML_gmxCodelists.xml"
filename instead of"gmxCodelists.xml"
- See Also:
-
UOM_PATH
The string to append toMETADATA_ROOT
or one of its alternative for obtaining the path to the definitions of units of measurement.A localized version of this file exists also with the
"ML_gmxUom.xml"
filename instead of"gmxUom.xml"
- See Also:
-
codeList
ThecodeList
attribute in the XML element. -
codeListValue
ThecodeListValue
attribute in the XML element. -
codeSpace
The optionalcodeSpace
attribute in the XML element. The default value isnull
. If a value is provided in this field, thenvalue
should be set as well.This attribute is set to the 3-letters language code of the value, as returned by
Locale.getISO3Language()
. -
value
The optional value to write in the XML element. The default value isnull
. If a value is provided in this field, thencodeSpace
is the language code of this field ornull
for English.
-
-
Constructor Details
-
CodeListUID
public CodeListUID()Default empty constructor for JAXB. -
CodeListUID
public CodeListUID(Context context, String codeList, String codeListValue, String codeSpace, String value) Builds a code list with the given attributes.- Parameters:
context
- the current (un)marshalling context, ornull
if none.codeList
- thecodeList
attribute, to be concatenated after the"#"
symbol.codeListValue
- thecodeListValue
attribute, to be declared in the XML element.codeSpace
- the 3-letters language code of thevalue
attribute, ornull
if none.value
- the value in the language specified by thecodeSpace
attribute, ornull
if none.
-
CodeListUID
Builds a value forCodeListAdapter
elements. This constructors stores the values that will be used for marshalling.- Parameters:
context
- the current (un)marshalling context, ornull
if none.code
- the code list to wrap.
-
-
Method Details
-
schema
Returns the URL to a given code list in the given XML file. This method concatenates the base schema URL with the given identifier. Some examples of strings returned by this method are:"http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#LanguageCode"
"http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#LanguageCode"
"http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode"
"http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_OnLineFunctionCode"
- Parameters:
context
- the current (un)marshalling context, ornull
if none.identifier
- the UML identifier of the code list.- Returns:
- the URL to the given code list in the given schema.
- See Also:
-
toString
Returns the identifier to use for fetching aCodeList
instance. This is normally thecodeListValue
attribute. However if the code list is actually used as an enumeration, then the above attribute is null and we have to use directly the value instead.
-