|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mailster.gui.prefs.utils.LanguageResource
public class LanguageResource
Models a container for localized language specific resources.
| Field Summary | |
|---|---|
private java.util.ResourceBundle |
bundle
The ResourceBundle associated to the
LanguageResource |
static java.lang.String |
KEY_NOT_FOUND
Predefined String constant for unknown keys which are not
part of the LanguageResource |
private static java.lang.String |
TRANSLATION_DATE
Predefined key to access the date of translation of a LanguageResource |
private static java.lang.String |
TRANSLATION_VERSION
Predefined key to access the translation version of a LanguageResource |
private static java.lang.String |
TRANSLATOR_KEY
Predefined key to access the name of the translator of a LanguageResource |
| Constructor Summary | |
|---|---|
LanguageResource(java.util.ResourceBundle bundle)
Creates a new LanguageResource which works on the
specified ResourceBundle, i.e. extracts the messages from
it. |
|
| Method Summary | |
|---|---|
int |
compareTo(LanguageResource obj)
Compares this LanguageResource with the specified object
for order. |
boolean |
equals(java.lang.Object obj)
Tests if this LanguageResource equals the specified
obj which also has to be a LanguageResource. |
java.lang.String |
getFormattedString(java.lang.String key,
java.lang.Object[] arguments)
Gets a localized formatted String from this
LanguageResource matching the specified key. |
java.lang.String |
getFullISOLanguage()
Returns the lowercase ISO 639 code of this LanguageResource,
e.g. |
java.lang.String |
getISOLanguage()
Gets the lowercase ISO 639 code of this LanguageResource,
e.g. |
java.lang.String |
getLanguage()
Gets the full language identifier of this LanguageResource,
e.g. |
java.lang.String |
getLanguage(LanguageResource resource)
Gets the full language identifier of this LanguageResource,
e.g. |
java.lang.String |
getString(java.lang.String key)
Gets a localized String from this
LanguageResource matching the specified key. |
java.lang.String |
getTranslationDate()
Gets the date of translation of this LanguageResource. |
java.lang.String |
getTranslator()
Gets the name of the translator of this LanguageResource. |
java.lang.String |
getVersion()
Gets the version of this LanguageResource,
e.g. the version of the application with which the resource is compliant. |
java.lang.String |
toString()
Converts this LanguageResource to a human readable
representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String KEY_NOT_FOUND
String constant for unknown keys which are not
part of the LanguageResource
private static final java.lang.String TRANSLATOR_KEY
LanguageResource
private static final java.lang.String TRANSLATION_DATE
LanguageResource
private static final java.lang.String TRANSLATION_VERSION
LanguageResource
private java.util.ResourceBundle bundle
ResourceBundle associated to the
LanguageResource
| Constructor Detail |
|---|
public LanguageResource(java.util.ResourceBundle bundle)
LanguageResource which works on the
specified ResourceBundle, i.e. extracts the messages from
it.
bundle - the associated ResourceBundle| Method Detail |
|---|
public java.lang.String getFullISOLanguage()
LanguageResource,
e.g. "en" for English. If a country code is available then it will be
postfixed to the ISO code e.g. "pt_br" for Brazil.
public java.lang.String getISOLanguage()
LanguageResource,
e.g. "en" for English.
LanguageResourcepublic java.lang.String getVersion()
LanguageResource,
e.g. the version of the application with which the resource is compliant.
LanguageResourcepublic java.lang.String getLanguage()
LanguageResource,
e.g. "English". If possible, the name returned will be localized
according to the current default LanguageResource. For
example, if the LanguageResource is fr and the default
LanguageResource is en, getLanguage(LanguageResource) will
return "French"; if the LanguageResource is en and the
default LanguageResource is fr,
getLanguage(LanguageResource) will return "anglais".
LanguageResourcegetLanguage(LanguageResource)public java.lang.String getLanguage(LanguageResource resource)
LanguageResource,
e.g. "English". If possible, the name returned will be localized
according to resource. For example, if the
LanguageResource is fr and resource is en,
getLanguage(LanguageResource) will return "French"; if the
LanguageResource is en and resource is fr,
getLanguage(LanguageResource) will return "anglais".
resource - the LanguageResource to use for getting
the language
LanguageResourcegetLanguage()public java.lang.String getTranslator()
LanguageResource.
LanguageResourcepublic java.lang.String getTranslationDate()
LanguageResource.
LanguageResourcepublic java.lang.String getString(java.lang.String key)
String from this
LanguageResource matching the specified key.
key - the key of the localized String to access
String; KEY_NOT_FOUND if
the key is not part of this LanguageResource
public java.lang.String getFormattedString(java.lang.String key,
java.lang.Object[] arguments)
String from this
LanguageResource matching the specified key.
key - the key of the localized String to accessarguments - a list of parameters to use for formatting
String;
KEY_NOT_FOUND if the key is not part of this
LanguageResourcepublic java.lang.String toString()
LanguageResource to a human readable
representation.
toString in class java.lang.ObjectLanguageResource as returned
by the getLanguage() method
public boolean equals(java.lang.Object obj)
LanguageResource equals the specified
obj which also has to be a LanguageResource.
Two LanguageResources are considered equal if both have
the same language as returned by the getLanguage() method.
equals in class java.lang.Objectobj - the Object to test for equality
true if this LanguageResource
equals the specified obj; false
otherwisepublic int compareTo(LanguageResource obj)
LanguageResource with the specified object
for order. Returns a negative integer, zero, or a positive integer as
this object is less than, equal to, or greater than the specified object.
In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive.
compareTo in interface java.lang.Comparable<LanguageResource>obj - the Object to be compared.
LanguageResource is less than, equal to, or
greater than the specified object.
java.lang.ClassCastException - if the specified object's type prevents it
from being compared to this Object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||