net.sf.mmm.util.nls.base
Class SimpleNlsFormatter<O>
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<O>
- Type Parameters:
O - is the generic type of the object to
format(Object, Locale, Map, NlsTemplateResolver).
- All Implemented Interfaces:
- NlsFormatter<O>, NlsFormatterPlugin<O>
- Direct Known Subclasses:
- AbstractSimpleNlsFormatterDate, NlsFormatterCurrency, NlsFormatterDatePattern, NlsFormatterInteger, NlsFormatterNumber, NlsFormatterNumberPattern, NlsFormatterPercent
public abstract class SimpleNlsFormatter<O>
- extends AbstractNlsFormatterPlugin<O>
This is an abstract base implementation of
NlsFormatter that adapts a Format.
- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
SimpleNlsFormatter
public SimpleNlsFormatter()
- The constructor.
createFormat
protected abstract Format createFormat(Locale locale)
- This method creates the underlying
Format to delegate to.
- Parameters:
locale - is the locale of the Format to create.
- Returns:
- the according format.
format
public String format(O object,
Locale locale,
Map<String,Object> arguments,
NlsTemplateResolver resolver)
- This method formats the given
object according to the given
locale.
- Specified by:
format in interface NlsFormatter<O>- Overrides:
format in class AbstractNlsFormatter<O>
- Parameters:
object - is the object to format.locale - is the locale used for localized formatting.arguments - is the Map of arguments.resolver - is the NlsTemplateResolver.
- Returns:
- the formatted and localized string for the given
object.
format
public void format(O object,
Locale locale,
Map<String,Object> arguments,
NlsTemplateResolver resolver,
Appendable buffer)
- This method formats the given
object according to the given
locale.
- Parameters:
object - is the object to format.locale - is the locale used for localized formatting.arguments - is the Map of
arguments.resolver - is the NlsTemplateResolver.buffer - is where to append the formatted object.
Copyright © 2001-2010 mmm-Team. All Rights Reserved.