net.sf.mmm.util.nls.base
Class MappedNlsFormatterManager
java.lang.Object
net.sf.mmm.util.component.base.AbstractComponent
net.sf.mmm.util.component.base.AbstractLoggableComponent
net.sf.mmm.util.nls.base.AbstractNlsFormatterManager
net.sf.mmm.util.nls.base.MappedNlsFormatterManager
- All Implemented Interfaces:
- NlsArgumentParser, NlsFormatterManager
- Direct Known Subclasses:
- NlsFormatterManagerImpl
public abstract class MappedNlsFormatterManager
- extends AbstractNlsFormatterManager
This is the implementation of the
NlsFormatterManager interface.
- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
| Fields inherited from interface net.sf.mmm.util.nls.api.NlsFormatterManager |
STYLE_CURRENCY, STYLE_FULL, STYLE_INTEGER, STYLE_ISO_8601, STYLE_LONG, STYLE_MEDIUM, STYLE_PERCENT, STYLE_SHORT, TYPE_CHOICE, TYPE_DATE, TYPE_DATETIME, TYPE_NUMBER, TYPE_TIME, TYPE_TYPE |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
formatterMap
private NlsFormatterMap formatterMap
- See Also:
getFormatter(String, String)
MappedNlsFormatterManager
public MappedNlsFormatterManager()
- The constructor.
MappedNlsFormatterManager
public MappedNlsFormatterManager(NlsFormatterMap formatterMap)
- The constructor.
- Parameters:
formatterMap - is the map with the registered formatters.
getSubFormatter
protected NlsFormatter<Object> getSubFormatter(String formatType,
String subformat)
- This method creates the
NlsFormatter for the given
formatType and the custom subformat. It is called
if no formatter is
registered for the given arguments.
- Parameters:
formatType - is the type to be formatted.subformat - is the custom formatStyle for which no static formatter is
registered.
- Returns:
- the according custom formatter or
null if no such
formatter is could be created.
getFormatter
public 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
getFormatterMap
protected NlsFormatterMap getFormatterMap()
- Returns:
- the formatterMap
setFormatterMap
@Inject
public void setFormatterMap(NlsFormatterMap formatterMap)
- Parameters:
formatterMap - is the formatterMap to set
Copyright © 2001-2010 mmm-Team. All Rights Reserved.