net.sf.mmm.util.nls.impl.formatter
Class AbstractSimpleNlsFormatterDate
java.lang.Object
net.sf.mmm.util.component.base.AbstractComponent
net.sf.mmm.util.component.base.AbstractLoggableComponent
net.sf.mmm.util.nls.base.AbstractNlsFormatter<O>
net.sf.mmm.util.nls.base.AbstractNlsFormatterPlugin<O>
net.sf.mmm.util.nls.base.SimpleNlsFormatter<Object>
net.sf.mmm.util.nls.impl.formatter.AbstractSimpleNlsFormatterDate
- All Implemented Interfaces:
- NlsFormatter<Object>, NlsFormatterPlugin<Object>
- Direct Known Subclasses:
- NlsFormatterDate, NlsFormatterDateTime, NlsFormatterTime
public abstract class AbstractSimpleNlsFormatterDate
- extends SimpleNlsFormatter<Object>
This is the abstract base implementation for a SimpleNlsFormatter
using DateFormat.
- Since:
- 2.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
|
Field Summary |
private int |
style
|
style
private final int style
- See Also:
createFormat(Locale)
AbstractSimpleNlsFormatterDate
public AbstractSimpleNlsFormatterDate(int style)
- The constructor.
- Parameters:
style - is the style used for formatting dates (e.g.
DateFormat.SHORT).
convertStyle
static String convertStyle(int style)
- This method converts the given
DateFormat-style constant (e.g.
DateFormat.LONG) to the according NLS-style
name.
- Parameters:
style - is the DateFormat-style constant (e.g.
DateFormat.MEDIUM).
- Returns:
- the according
NLS-style name or
null if unknown.
createFormat
protected Format createFormat(Locale locale)
- This method creates the underlying
Format to delegate to.
- Specified by:
createFormat in class SimpleNlsFormatter<Object>
- Parameters:
locale - is the locale of the Format to create.
- Returns:
- the according format.
getStyle
public String getStyle()
- This method gets the
style of this formatter. See STYLE_* constants of
NlsFormatterManager e.g.
NlsFormatterManager.STYLE_LONG.
- Returns:
- the style or
null for no style.
Copyright © 2001-2010 mmm-Team. All Rights Reserved.