-
public interface NlsFormatterManagerThis is the interface for a manager ofNlsFormatters.
A legal implementation of this interface has to be thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description static StringSTYLE_CURRENCYstatic StringSTYLE_FULLstatic StringSTYLE_INTEGERstatic StringSTYLE_ISO_8601ISO-8601 date/time formatstatic StringSTYLE_LONGstatic StringSTYLE_MEDIUMstatic StringSTYLE_PERCENTstatic StringSTYLE_SHORTstatic StringTYPE_CHOICEstatic StringTYPE_DATEstatic StringTYPE_DATETIMEstatic StringTYPE_NUMBERstatic StringTYPE_TIMEstatic StringTYPE_TYPEFormat forType
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static NlsFormatterManagerget()default NlsFormatterPlugingetFormatter()default NlsFormatterPlugingetFormatter(String formatType)NlsFormatterPlugingetFormatter(String formatType, CharSequenceScanner scanner)This method is likegetFormatter(String, String)but reads thestylefrom the given scanner.NlsFormatterPlugingetFormatter(String formatType, String formatStyle)
-
-
-
Field Detail
-
TYPE_NUMBER
static final String TYPE_NUMBER
- See Also:
NumberFormat, Constant Field Values
-
TYPE_DATE
static final String TYPE_DATE
-
TYPE_TIME
static final String TYPE_TIME
-
TYPE_DATETIME
static final String TYPE_DATETIME
-
TYPE_CHOICE
static final String TYPE_CHOICE
- See Also:
NlsFormatterPluginChoice, Constant Field Values
-
TYPE_TYPE
static final String TYPE_TYPE
Format forType- See Also:
- Constant Field Values
-
STYLE_SHORT
static final String STYLE_SHORT
- See Also:
DateFormat.SHORT, Constant Field Values
-
STYLE_MEDIUM
static final String STYLE_MEDIUM
- See Also:
DateFormat.MEDIUM, Constant Field Values
-
STYLE_LONG
static final String STYLE_LONG
- See Also:
DateFormat.LONG, Constant Field Values
-
STYLE_FULL
static final String STYLE_FULL
- See Also:
DateFormat.FULL, Constant Field Values
-
STYLE_INTEGER
static final String STYLE_INTEGER
-
STYLE_CURRENCY
static final String STYLE_CURRENCY
-
STYLE_PERCENT
static final String STYLE_PERCENT
-
STYLE_ISO_8601
static final String STYLE_ISO_8601
ISO-8601 date/time format- See Also:
- Constant Field Values
-
-
Method Detail
-
getFormatter
default NlsFormatterPlugin getFormatter()
- Returns:
- the default
NlsFormatterinstance. - See Also:
getFormatter(String, String)
-
getFormatter
default NlsFormatterPlugin getFormatter(String formatType)
- Parameters:
formatType- is thetypeto be formatted.- Returns:
- the according
NlsFormatterPlugininstance. - See Also:
getFormatter(String, String)
-
getFormatter
NlsFormatterPlugin getFormatter(String formatType, String formatStyle)
This method gets theNlsFormatterfor the givenformatTypeandformatStyle.
To be compliant withMessageFormatthe following types and styles need to be supported by the implementation:
formatType:
formatStyle:shortmediumlongfullintegercurrencypercentiso8601- additional custom styles (named [a-z]*)
- anything else will be treated as SubformatPattern
The support forChoiceFormats is NOT provided in a compatible way as by hacking internal arrays ofMessageFormat. Instead this implementation provides a clean configuration viaformatStylewhenformatTypeischoice(seeNlsFormatterPluginChoice).- Parameters:
formatType- is the type to be formatted.formatStyle- is the style defining details of formatting.- Returns:
- the according
NlsFormatterinstance. - See Also:
MessageFormat
-
getFormatter
NlsFormatterPlugin getFormatter(String formatType, CharSequenceScanner scanner)
This method is likegetFormatter(String, String)but reads thestylefrom the given scanner.- Parameters:
formatType- is the type to be formatted.scanner- is the currentCharSequenceScannerfor parsing the style defining details of formatting.- Returns:
- the according
NlsFormatter.
-
get
static NlsFormatterManager get()
- Returns:
- the instance of
NlsFormatterManager.
-
-