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

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.NlsFormatterNumberPattern
All Implemented Interfaces:
NlsFormatter<Object>, NlsFormatterPlugin<Object>

public final class NlsFormatterNumberPattern
extends SimpleNlsFormatter<Object>

This is an implementation of NlsFormatter using DecimalFormat.

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

Field Summary
private  String pattern
           
 
Constructor Summary
NlsFormatterNumberPattern(String pattern)
          The constructor.
 
Method Summary
 Format createFormat(Locale locale)
          This method creates the underlying Format to delegate to.
 String getStyle()
          This method gets the style of this formatter.
 String getType()
          This method gets the type 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
 

Field Detail

pattern

private final String pattern
See Also:
createFormat(Locale)
Constructor Detail

NlsFormatterNumberPattern

public NlsFormatterNumberPattern(String pattern)
The constructor.

Parameters:
pattern - is the pattern for the DecimalFormat.
Method Detail

createFormat

public 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.

getType

public String getType()
This method gets the type of this formatter. See TYPE_* constants of NlsFormatterManager e.g. NlsFormatterManager.TYPE_NUMBER.

Returns:
the type or null for the default formatter. If type is null then also style needs to be null.

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.