|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.util.AbstractISOCodeMapper anon.util.LanguageMapper
public class LanguageMapper
Objects of this class store a language code and can translate it into the localised name of the corresponding language. The default locale of this class is bound to the locale used in JAPMessages.
JAPMessages
,
http://www.w3.org/WAI/ER/IG/ert/iso639.htm
Field Summary | |
---|---|
private java.util.Locale |
m_locale
|
private static java.lang.String[] |
ms_languageCodes
|
private static java.lang.String |
MSG_CHOOSE_LANGUAGE
|
Constructor Summary | |
---|---|
LanguageMapper()
Constructs an empty LanguageMapper object. |
|
LanguageMapper(int a_maxTextLength)
Constructs an empty LanguageMapper object. |
|
LanguageMapper(java.lang.String a_ISOCode)
Constructs a new LanguageMapper that uses the default Locale to translate its language code. |
|
LanguageMapper(java.lang.String a_ISOCode,
int a_maxTextLength)
Constructs a new LanguageMapper that uses the default Locale to translate its language code. |
|
LanguageMapper(java.lang.String a_ISOCode,
int a_maxTextLength,
java.util.Locale a_locale)
Constructs a new LanguageMapper that uses a specific Locale to translate its language code. |
|
LanguageMapper(java.lang.String a_ISOCode,
java.util.Locale a_locale)
Constructs a new LanguageMapper that uses a specific Locale to translate its language code. |
Method Summary | |
---|---|
private void |
createLocale()
Creates the internal Locale object from the language code. |
protected java.lang.String |
getChooseMessage()
Returns a message that is displayed when this mapped object has an empty ISO code. |
protected java.lang.String |
getJRETransaltionOfISOCode(java.lang.String a_ISOLanguageCode,
java.util.Locale a_locale)
|
java.util.Locale |
getLocale()
Returns a Locale object constructed from the language code. |
java.util.Locale |
getLocale(java.lang.String a_countryCode)
Creates a Locale object from the language code and a given country code. |
static java.util.Vector |
getLocalisedLanguages()
Returns a Vector with LanguageMappers for all officially assigned language codes. |
static java.util.Vector |
getLocalisedLanguages(int a_maxTextLength)
Returns a Vector with LanguageMappers for all officially assigned language codes. |
static java.util.Vector |
getLocalisedLanguages(int a_maxTextLength,
java.util.Locale a_loc)
Returns a Vector with LanguageMappers for all officially assigned language codes. |
static java.util.Vector |
getLocalisedLanguages(java.util.Locale a_loc)
Returns a Vector with LanguageMappers for all officially assigned language codes. |
Methods inherited from class anon.util.AbstractISOCodeMapper |
---|
equals, getISOCode, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String[] ms_languageCodes
private static final java.lang.String MSG_CHOOSE_LANGUAGE
private java.util.Locale m_locale
Constructor Detail |
---|
public LanguageMapper()
public LanguageMapper(int a_maxTextLength)
a_maxTextLength
- the maximum length of the toString() outputpublic LanguageMapper(java.lang.String a_ISOCode, int a_maxTextLength) throws java.lang.IllegalArgumentException
a_ISOCode
- a two-letter language codea_maxTextLength
- the maximum length of the toString() output
java.lang.IllegalArgumentException
getLocalisedCountries(int)
public LanguageMapper(java.lang.String a_ISOCode) throws java.lang.IllegalArgumentException
a_ISOCode
- a two-letter language code
java.lang.IllegalArgumentException
getLocalisedCountries(int)
public LanguageMapper(java.lang.String a_ISOCode, java.util.Locale a_locale) throws java.lang.IllegalArgumentException
a_ISOCode
- a two-letter language codea_locale
- a Locale
java.lang.IllegalArgumentException
getLocalisedCountries(int, Locale)
public LanguageMapper(java.lang.String a_ISOCode, int a_maxTextLength, java.util.Locale a_locale) throws java.lang.IllegalArgumentException
a_ISOCode
- a two-letter language codea_locale
- a Localea_maxTextLength
- the maximum length of the toString() output
java.lang.IllegalArgumentException
getLocalisedCountries(int, Locale)
Method Detail |
---|
public java.util.Locale getLocale()
public java.util.Locale getLocale(java.lang.String a_countryCode)
a_countryCode
- an ISO country code
CountryMapper
public static java.util.Vector getLocalisedLanguages()
public static java.util.Vector getLocalisedLanguages(java.util.Locale a_loc)
a_loc
- the locale that is used in all contructed LanguageMappers
public static java.util.Vector getLocalisedLanguages(int a_maxTextLength)
a_maxTextLength
- the maximum length of the toString() output
public static java.util.Vector getLocalisedLanguages(int a_maxTextLength, java.util.Locale a_loc)
a_loc
- the locale that is used in all constructed LanguageMappersa_maxTextLength
- the maximum length of the toString() output
protected final java.lang.String getChooseMessage()
AbstractISOCodeMapper
getChooseMessage
in class AbstractISOCodeMapper
protected java.lang.String getJRETransaltionOfISOCode(java.lang.String a_ISOLanguageCode, java.util.Locale a_locale)
getJRETransaltionOfISOCode
in class AbstractISOCodeMapper
private void createLocale()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |