net.sf.mmm.util.nls.api
Interface NlsFormatterManager

All Known Implementing Classes:
AbstractNlsFormatterManager, MappedNlsFormatterManager, NlsFormatterManagerImpl

public interface NlsFormatterManager

This is the interface for a manager of NlsFormatters.
A legal implementation of this interface has to be thread-safe.

Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
static String STYLE_CURRENCY
           
static String STYLE_FULL
           
static String STYLE_INTEGER
           
static String STYLE_ISO_8601
           
static 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 for Type
 
Method Summary
 NlsFormatter<Object> getFormatter()
          This method gets the default NlsFormatter.
 NlsFormatter<?> getFormatter(String formatType)
          This method gets the NlsFormatter for the given formatType.
 NlsFormatter<?> getFormatter(String formatType, String formatStyle)
          This method gets the NlsFormatter for the given formatType and formatStyle.
 

Field Detail

TYPE_NUMBER

static final String TYPE_NUMBER
See Also:
NumberFormat, Constant Field Values

TYPE_DATE

static final String TYPE_DATE
See Also:
DateFormat.getDateInstance(int, java.util.Locale), Constant Field Values

TYPE_TIME

static final String TYPE_TIME
See Also:
DateFormat.getTimeInstance(int, java.util.Locale), Constant Field Values

TYPE_DATETIME

static final String TYPE_DATETIME
See Also:
DateFormat.getDateTimeInstance(int, int, java.util.Locale), Constant Field Values

TYPE_CHOICE

static final String TYPE_CHOICE
See Also:
ChoiceFormat, Constant Field Values

TYPE_TYPE

static final String TYPE_TYPE
Format for Type

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
See Also:
NumberFormat.getIntegerInstance(), Constant Field Values

STYLE_CURRENCY

static final String STYLE_CURRENCY
See Also:
NumberFormat.getCurrencyInstance(), Constant Field Values

STYLE_PERCENT

static final String STYLE_PERCENT
See Also:
NumberFormat.getPercentInstance(), Constant Field Values

STYLE_ISO_8601

static final String STYLE_ISO_8601
See Also:
Iso8601Util, Constant Field Values
Method Detail

getFormatter

NlsFormatter<Object> getFormatter()
This method gets the default NlsFormatter.

Returns:
the default NlsFormatter instance.
See Also:
getFormatter(String, String)

getFormatter

NlsFormatter<?> getFormatter(String formatType)
This method gets the NlsFormatter for the given formatType.

Parameters:
formatType - is the type to be formatted.
Returns:
the according NlsFormatter instance.
See Also:
getFormatter(String, String)

getFormatter

NlsFormatter<?> getFormatter(String formatType,
                             String formatStyle)
This method gets the NlsFormatter for the given formatType and formatStyle.
To be compliant with MessageFormat the following types and styles need to be supported by the implementation:

formatType:
formatStyle: ATTENTION:
The support for ChoiceFormats is NOT provided in a compatible way as by hacking internal arrays of MessageFormat. Instead this implementation provides a clean configuration via formatStyle when formatType is choice (see NlsFormatterChoice).

Parameters:
formatType - is the type to be formatted.
formatStyle - is the style defining details of formatting.
Returns:
the according NlsFormatter instance.
See Also:
MessageFormat


Copyright © 2001-2010 mmm-Team. All Rights Reserved.