com.pelzer.util.l10n.localizers
Class Localizer

java.lang.Object
  extended by com.pelzer.util.l10n.localizers.Localizer
All Implemented Interfaces:
Serializable, Comparable<Localizer>
Direct Known Subclasses:
LanguageLocalizer, ScriptLocalizer, TerritoryLocalizer

public abstract class Localizer
extends Object
implements Comparable<Localizer>, Serializable

Wrapper for language or territory.

See Also:
Serialized Form

Field Summary
protected  int id
          The underlying id for an instance in persistent storage.
protected static String WILDCARD_IDENTIFIER
           
 
Constructor Summary
Localizer(String identifier, String description)
          Identifier is the unique id that the ISO (or other standards body) has assigned this localizer, description is the english description, native description is the locale-specific description, or null if it's not available or the same.
Localizer(String identifier, String description, String nativeDescription)
           
 
Method Summary
 int compareTo(Localizer localizer)
           
 boolean equals(Object obj)
           
 String getDescription()
          Human-readable description of the identifier.
 String getIdentifier()
          A shorted code, usually very short based on various ISO codes for language, territory or script.
 String getNativeDescription()
           
 int hashCode()
           
 boolean isWildCard()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WILDCARD_IDENTIFIER

protected static final String WILDCARD_IDENTIFIER
See Also:
Constant Field Values

id

protected int id
The underlying id for an instance in persistent storage. Not settable by anything other than hibernate, and your own system will need to map this correctly for your storage system.

Constructor Detail

Localizer

public Localizer(String identifier,
                 String description)
Identifier is the unique id that the ISO (or other standards body) has assigned this localizer, description is the english description, native description is the locale-specific description, or null if it's not available or the same.


Localizer

public Localizer(String identifier,
                 String description,
                 String nativeDescription)
Method Detail

isWildCard

public boolean isWildCard()
Returns:
true if this localizer has been set to be a wildcard, ie: always matches

getIdentifier

public String getIdentifier()
A shorted code, usually very short based on various ISO codes for language, territory or script. This is the main payload for a Localizer instance.


getDescription

public String getDescription()
Human-readable description of the identifier.


getNativeDescription

public String getNativeDescription()
Returns:
the native description for a given Localizer, for instance Deutschland for Germany, or the english description if the native description is null.

compareTo

public int compareTo(Localizer localizer)
Specified by:
compareTo in interface Comparable<Localizer>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2012. All Rights Reserved.