net.sf.mmm.util.nls.impl.formatter
Class AbstractSimpleNlsFormatterDate

java.lang.Object
  extended by net.sf.mmm.util.component.base.AbstractComponent
      extended by net.sf.mmm.util.component.base.AbstractLoggableComponent
          extended by net.sf.mmm.util.nls.base.AbstractNlsFormatter<O>
              extended by net.sf.mmm.util.nls.base.AbstractNlsFormatterPlugin<O>
                  extended by net.sf.mmm.util.nls.base.SimpleNlsFormatter<Object>
                      extended by 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
           
 
Constructor Summary
AbstractSimpleNlsFormatterDate(int style)
          The constructor.
 
Method Summary
(package private) static String convertStyle(int style)
          This method converts the given DateFormat-style constant (e.g.
protected  Format createFormat(Locale locale)
          This method creates the underlying Format to delegate to.
 String getStyle()
          This method gets the style of this formatter.
 
Methods inherited from class net.sf.mmm.util.nls.base.SimpleNlsFormatter
format, format
 
Methods inherited from class net.sf.mmm.util.nls.base.AbstractNlsFormatterPlugin
toString
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractLoggableComponent
doInitialize, getLogger, setLogger
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractComponent
doInitialized, getInitializationState, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.mmm.util.nls.api.NlsFormatterPlugin
getType
 

Field Detail

style

private final int style
See Also:
createFormat(Locale)
Constructor Detail

AbstractSimpleNlsFormatterDate

public AbstractSimpleNlsFormatterDate(int style)
The constructor.

Parameters:
style - is the style used for formatting dates (e.g. DateFormat.SHORT).
Method Detail

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.