public abstract class LocalizerBase extends java.lang.Object implements Localizer
localize()
.
If multiple threads are accessing this object, they should synchronize on it.
Modifier and Type | Field and Description |
---|---|
protected java.text.NumberFormat |
decimalFormater |
protected java.text.NumberFormat |
integerFormater |
Constructor and Description |
---|
LocalizerBase(java.util.Locale locale) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getLanguage()
Returns the ISO language code of the java.util.Locale object currently used for rendering
|
java.util.Locale |
getLocale()
Returns the java.util.Locale object that is currently used for formatting
|
java.lang.String |
localize(java.util.Date date,
java.lang.String patternCode)
Returns a String representing the specified Date object using the format pattern that is represented
by the specified code.
|
java.lang.String |
localize(double number,
int digits)
Renders the specified double value with exactly the number of specified
digits and according to the rulse imposed by the currently used Locale object of
this Localizer instance.
|
java.lang.String |
localize(long number)
Returns a String representing the specified long value and rendered for the currently
used Locale of this Localizer instance.
|
java.lang.String |
localize(java.lang.String code,
java.lang.Object replacementValue)
Returns some locale specific, human readable text for the specified code,
filled with the specified replacement value using java.text.MessageFormat syntax.
|
java.lang.String |
localize(java.lang.String code,
java.lang.Object[] replacementValues)
Returns some locale specific, human readable text for the specified code,
filled with the specified replacement values using java.text.MessageFormat syntax.
|
java.util.Date |
parseDate(java.lang.String date,
java.lang.String patternCode)
Returns the java.util.Date object that is represented by the specified String.
|
java.lang.Double |
parseDouble(java.lang.String doubleNumber)
Returns the double value that is represented by the specified String, or throws
a ParseException if parsing fails.
|
java.lang.Integer |
parseInt(java.lang.String integerNumber)
Returns the int value that is represented by the specified String, or throws
a ParseException if parsing fails.
|
java.lang.Long |
parseLong(java.lang.String longNumber)
Returns the long value that is represented by the specified String, or throws
a ParseException if parsing fails.
|
protected java.text.NumberFormat integerFormater
protected java.text.NumberFormat decimalFormater
public java.lang.String getLanguage()
getLanguage
in interface Localizer
public java.util.Locale getLocale()
public java.lang.String localize(java.lang.String code, java.lang.Object replacementValue)
localize()
method.localize
in interface Localizer
code
- application internal code for some textreplacementValue
- object that shall be filled into the place holder of the resulting text.Localizer.localize(String, Object[])
public java.lang.String localize(java.lang.String code, java.lang.Object[] replacementValues)
public java.lang.String localize(long number)
public java.lang.String localize(double number, int digits)
public java.lang.String localize(java.util.Date date, java.lang.String patternCode)
public java.util.Date parseDate(java.lang.String date, java.lang.String patternCode)
public java.lang.Integer parseInt(java.lang.String integerNumber)
public java.lang.Long parseLong(java.lang.String longNumber)
public java.lang.Double parseDouble(java.lang.String doubleNumber)
parseDouble
in interface Localizer
doubleNumber
- String that represents a double value