|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.doolin.util.I18NString
public class I18NString
String that has different values according to a locale.
| Constructor Summary | |
|---|---|
I18NString()
Constructor for no value |
|
I18NString(I18NString name)
Copy constructor |
|
I18NString(Locale locale,
String value)
Constructor for a given locale and without any default value |
|
I18NString(String value)
Constructor with a default value. |
|
I18NString(String defaultValue,
Locale locale,
String value)
Constructor for a given locale and with a default value |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Equality. |
String |
format()
Formatted representation, used for encoding. |
String |
getDefaultValue()
Get the default value |
Iterator<Locale> |
getKeys()
Get all defined locales |
String |
getLocaleValue(Locale locale)
Get value for a locale, returning null if not found |
String |
getValue()
Value for the current locale. |
String |
getValue(Locale locale)
Get value for a locale, returning default if not found |
int |
hashCode()
Hash code |
static I18NString |
parse(String value)
Parses a formatted string. |
void |
setDefaultValue(String value)
Set the default value |
void |
setValue(Locale locale,
String value)
Set value for a locale |
void |
setValue(String locale,
String value)
Utility method, whose purpose if for introspection tools. |
String |
toString()
Value for the current locale |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public I18NString()
public I18NString(String value)
value - Default value
public I18NString(Locale locale,
String value)
locale - Locale for the given valuevalue - Value to set for the given locale
public I18NString(String defaultValue,
Locale locale,
String value)
defaultValue - Default valuelocale - Locale for the given valuevalue - Value to set for the given localepublic I18NString(I18NString name)
name - Object to copy| Method Detail |
|---|
public String getValue(Locale locale)
locale - Locale to get the value for
public String getLocaleValue(Locale locale)
null if not found
locale - Locale to get the value for
nullpublic String getDefaultValue()
public void setDefaultValue(String value)
value - Default value
public void setValue(Locale locale,
String value)
locale - Locale to get the value forvalue - Value for this locale
public void setValue(String locale,
String value)
locale - If null, set the default value.value - Value to set.LocaleUtils.parseLocale(String)public String toString()
toString in class Objectpublic String getValue()
public Iterator<Locale> getKeys()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String format()
<defaultValue>{\\<locale>=<value>}*
public static I18NString parse(String value)
format method.
value - Value to parse (it must be a result of a previous call to the
format method
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||