-
public interface NlsFormatterManager
This is the interface for a manager ofNlsFormatter
s.
A legal implementation of this interface has to be thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description static String
STYLE_CURRENCY
static String
STYLE_FULL
static String
STYLE_INTEGER
static String
STYLE_ISO_8601
ISO-8601 date/time formatstatic String
STYLE_LONG
static String
STYLE_MEDIUM
static String
STYLE_PERCENT
static String
STYLE_SHORT
static String
TYPE_CHOICE
static String
TYPE_DATE
static String
TYPE_DATETIME
static String
TYPE_NUMBER
static String
TYPE_TIME
static String
TYPE_TYPE
Format forType
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static NlsFormatterManager
get()
default NlsFormatterPlugin
getFormatter()
default NlsFormatterPlugin
getFormatter(String formatType)
NlsFormatterPlugin
getFormatter(String formatType, CharSequenceScanner scanner)
This method is likegetFormatter(String, String)
but reads thestyle
from the given scanner.NlsFormatterPlugin
getFormatter(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
NlsFormatter
instance. - See Also:
getFormatter(String, String)
-
getFormatter
default NlsFormatterPlugin getFormatter(String formatType)
- Parameters:
formatType
- is thetype
to be formatted.- Returns:
- the according
NlsFormatterPlugin
instance. - See Also:
getFormatter(String, String)
-
getFormatter
NlsFormatterPlugin getFormatter(String formatType, String formatStyle)
This method gets theNlsFormatter
for the givenformatType
andformatStyle
.
To be compliant withMessageFormat
the following types and styles need to be supported by the implementation:
formatType
:
formatStyle
:short
medium
long
full
integer
currency
percent
iso8601
- additional custom styles (named [a-z]*)
- anything else will be treated as SubformatPattern
The support forChoiceFormat
s is NOT provided in a compatible way as by hacking internal arrays ofMessageFormat
. Instead this implementation provides a clean configuration viaformatStyle
whenformatType
ischoice
(seeNlsFormatterPluginChoice
).- Parameters:
formatType
- is the type to be formatted.formatStyle
- is the style defining details of formatting.- Returns:
- the according
NlsFormatter
instance. - See Also:
MessageFormat
-
getFormatter
NlsFormatterPlugin getFormatter(String formatType, CharSequenceScanner scanner)
This method is likegetFormatter(String, String)
but reads thestyle
from the given scanner.- Parameters:
formatType
- is the type to be formatted.scanner
- is the currentCharSequenceScanner
for parsing the style defining details of formatting.- Returns:
- the according
NlsFormatter
.
-
get
static NlsFormatterManager get()
- Returns:
- the instance of
NlsFormatterManager
.
-
-