Class ResourceInternationalString

  • All Implemented Interfaces:
    Serializable, CharSequence, Comparable<InternationalString>, InternationalString

    public class ResourceInternationalString
    extends AbstractInternationalString
    implements Serializable
    An international string backed by a resource bundle. A resource bundle can be a Java class or a properties file, one for each language. The constructor expects the fully qualified class name of the base resource bundle (the one used when no resource was found in the client's language). The right resource bundle is loaded at runtime for the client's language by looking for a class or a properties file with the right suffix ("_en" for English or " _fr" for French). This mechanism is explained in J2SE's javadoc for the getBundle static method.

    Example: If a file named "" exists in the package " org.geotools.mypackage" and contains a line like "MyKey = some value", then an international string for "some value" can be created using the following code:

    InternationalString value = new ResourceInternationalString( "org.geotools.mypackage.MyResources", "MyKey");
    The "some value" string will be localized if the required properties files exist, for example "" for French, "" for Italian, etc.
    Martin Desruisseaux (IRD)
    See Also:
    Serialized Form
    • Constructor Detail

      • ResourceInternationalString

        public ResourceInternationalString​(String resources,
                                           String key)
        Creates a new international string from the specified resource bundle and key.
        resources - The name of the resource bundle, as a fully qualified class name.
        key - The key for the resource to fetch.
    • Method Detail

      • equals

        public boolean equals​(Object object)
        Compares this international string with the specified object for equality.
        equals in class Object
        object - The object to compare with this international string.
        true if the given object is equals to this string.
      • hashCode

        public int hashCode()
        Returns a hash code value for this international text.
        hashCode in class Object