public class ResourceBundleTokenTranslator extends InvalidTokenTranslator
Modifier and Type | Field and Description |
---|---|
static char |
DEFAULT_KEY_SEPARATOR |
static char |
DEFAULT_VALUE_SEPARATOR |
behaviour, empty, RETURN_EMPTY_STRING, RETURN_NULL, RETURN_TOKEN_STRING
Constructor and Description |
---|
ResourceBundleTokenTranslator(ResourceBundle rb) |
ResourceBundleTokenTranslator(ResourceBundle rb,
boolean useMessageFormat) |
ResourceBundleTokenTranslator(ResourceBundle rb,
boolean useMessageFormat,
int behaviour) |
ResourceBundleTokenTranslator(ResourceBundle rb,
int behaviour) |
Modifier and Type | Method and Description |
---|---|
boolean |
getUseMessageFormat()
Returns true if this ResourceBundleTokenTranslator is using
MesasgeFormat functionality; false otherwise.
|
void |
setKeySeparator(String s)
Sets the character that is used to separate the key from the values.
|
void |
setUseMessageFormat(boolean tf)
This method must be called if the MessageFormat functionality is
to be used.
|
void |
setValueSeparator(String s)
Sets the character that is used to separate values.
|
String |
translate(String token)
Translates the given string based on the format:
|
getBehaviour, getEmptyString, setBehaviour, setEmptyString, translateInvalidToken
public static final char DEFAULT_KEY_SEPARATOR
public static final char DEFAULT_VALUE_SEPARATOR
public ResourceBundleTokenTranslator(ResourceBundle rb)
public ResourceBundleTokenTranslator(ResourceBundle rb, int behaviour)
public ResourceBundleTokenTranslator(ResourceBundle rb, boolean useMessageFormat)
public ResourceBundleTokenTranslator(ResourceBundle rb, boolean useMessageFormat, int behaviour)
public void setUseMessageFormat(boolean tf)
tf
- true to use message format; false otherwisepublic boolean getUseMessageFormat()
public void setValueSeparator(String s)
s
- new value separatorpublic void setKeySeparator(String s)
s
- new key separatorpublic String translate(String token)
token
- original token stringCopyright © 2015. All Rights Reserved.