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
_ROOTsuffix are"http://"URL to a root directory. - Constants with the
_PATHsuffix are relative paths to concatenate to a_ROOTconstant in order to get the full path to a file. - Constants with the
_XSDsuffix 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.xmlfile exist also infoo.xml. - The converse of above point is not necessarily true:
the
ML_foo.xmlfile may contain only a subset offoo.xml. - All English descriptions in
ML_foo.xmlfile 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 TypeFieldDescriptionThecodeListattribute in the XML element.static final StringThe string to append toMETADATA_ROOTfor obtaining the path to the definitions of code lists.static final StringThe string to append toMETADATA_ROOT_LEGACYor one of its alternative for obtaining the path to the definitions of code lists.ThecodeListValueattribute in the XML element.The optionalcodeSpaceattribute in the XML element.static final StringThe namespace root of ISO 19115 objects.static final StringThe root directory of OGC metadata schemas.static final StringThe string to append toMETADATA_ROOTor 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 forCodeListAdapterelements. -
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_ROOTfor obtaining the path to the definitions of code lists.- See Also:
-
CODELISTS_PATH_LEGACY
The string to append toMETADATA_ROOT_LEGACYor 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_ROOTor 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
ThecodeListattribute in the XML element. -
codeListValue
ThecodeListValueattribute in the XML element. -
codeSpace
The optionalcodeSpaceattribute in the XML element. The default value isnull. If a value is provided in this field, thenvalueshould 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, thencodeSpaceis the language code of this field ornullfor 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, ornullif none.codeList- thecodeListattribute, to be concatenated after the"#"symbol.codeListValue- thecodeListValueattribute, to be declared in the XML element.codeSpace- the 3-letters language code of thevalueattribute, ornullif none.value- the value in the language specified by thecodeSpaceattribute, ornullif none.
-
CodeListUID
Builds a value forCodeListAdapterelements. This constructors stores the values that will be used for marshalling.- Parameters:
context- the current (un)marshalling context, ornullif 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, ornullif 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 aCodeListinstance. This is normally thecodeListValueattribute. 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.
-