Package org.apache.sis.util.iso
Class Types.Description
java.lang.Object
org.apache.sis.util.AbstractInternationalString
org.apache.sis.util.ResourceInternationalString
org.apache.sis.util.iso.Types.Description
- All Implemented Interfaces:
Serializable
,CharSequence
,Comparable<org.opengis.util.InternationalString>
,Formattable
,org.opengis.util.InternationalString
- Direct Known Subclasses:
Types.CodeTitle
- Enclosing class:
- Types
The
InternationalString
returned by the Types.getDescription(…)
methods.- Since:
- 0.3
- Version:
- 0.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ClassLoader
The class loader to use for fetching GeoAPI resources.private static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.util.ResourceInternationalString
key, resources
-
Constructor Summary
ConstructorsConstructorDescriptionDescription
(String resources, String key) Creates a new international string from the specified resource bundle and key. -
Method Summary
Modifier and TypeMethodDescription(package private) String
fallback()
Returns a fallback if no resource is found.protected final ResourceBundle
Loads the resources using the class loader used for loading GeoAPI interfaces.(package private) static String
resourceKey
(org.opengis.util.CodeList<?> code) Returns the resource key for the given code list.final String
Returns the description for the given locale, or fallback on a default description if no resources exist for that locale.Methods inherited from class org.apache.sis.util.ResourceInternationalString
equals, hashCode
Methods inherited from class org.apache.sis.util.AbstractInternationalString
charAt, compareTo, formatTo, length, subSequence, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
CLASSLOADER
The class loader to use for fetching GeoAPI resources. Since the resources are bundled in the GeoAPI JAR file, we use the instance that loaded GeoAPI for more determinist behavior.
-
-
Constructor Details
-
Description
Creates a new international string from the specified resource bundle and key.- Parameters:
resources
- the name of the resource bundle, as a fully qualified class name.key
- the key for the resource to fetch.
-
-
Method Details
-
getBundle
Loads the resources using the class loader used for loading GeoAPI interfaces.- Overrides:
getBundle
in classResourceInternationalString
- Parameters:
locale
- the locale for which to get the resource bundle.- Returns:
- the resource bundle for the given locale.
- See Also:
-
toString
Returns the description for the given locale, or fallback on a default description if no resources exist for that locale.- Specified by:
toString
in interfaceorg.opengis.util.InternationalString
- Overrides:
toString
in classResourceInternationalString
- Parameters:
locale
- the desired locale for the string to be returned.- Returns:
- the string in the specified locale, or in a fallback locale.
- See Also:
-
fallback
String fallback()Returns a fallback if no resource is found. -
resourceKey
Returns the resource key for the given code list.
-