Class 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

private static class Types.Description extends ResourceInternationalString
The InternationalString returned by the Types.getDescription(…) methods.
Since:
0.3
Version:
0.3
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • CLASSLOADER

      private static final ClassLoader 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

      Description(String resources, String key)
      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

      protected final ResourceBundle getBundle(Locale locale)
      Loads the resources using the class loader used for loading GeoAPI interfaces.
      Overrides:
      getBundle in class ResourceInternationalString
      Parameters:
      locale - the locale for which to get the resource bundle.
      Returns:
      the resource bundle for the given locale.
      See Also:
    • toString

      public final String toString(Locale locale)
      Returns the description for the given locale, or fallback on a default description if no resources exist for that locale.
      Specified by:
      toString in interface org.opengis.util.InternationalString
      Overrides:
      toString in class ResourceInternationalString
      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

      static String resourceKey(org.opengis.util.CodeList<?> code)
      Returns the resource key for the given code list.