net.sf.mmm.util.nls.impl
Class AbstractNlsFormatterDateIso8601

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<Object>
                  extended by net.sf.mmm.util.nls.impl.AbstractNlsFormatterDateIso8601
All Implemented Interfaces:
NlsFormatter<Object>, NlsFormatterPlugin<Object>
Direct Known Subclasses:
NlsFormatterDateIso8601, NlsFormatterDateTimeIso8601, NlsFormatterTimeIso8601

public abstract class AbstractNlsFormatterDateIso8601
extends AbstractNlsFormatterPlugin<Object>

This is an implementation of NlsFormatter for Dates.

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

Field Summary
private  Iso8601Util iso8601Util
           
 
Constructor Summary
AbstractNlsFormatterDateIso8601()
          The constructor.
AbstractNlsFormatterDateIso8601(Iso8601Util iso8601Util)
          The constructor.
 
Method Summary
protected  void doInitialize()
          This method performs the actual initialization.
protected  void format(Calendar calendar, Locale locale, Appendable buffer)
          This method formats the given calendar.
 void format(Object object, Locale locale, Map<String,Object> arguments, NlsTemplateResolver resolver, Appendable buffer)
          This method formats the given object according to the given locale.
 String getStyle()
          This method gets the style of this formatter.
 void setIso8601Util(Iso8601Util iso8601Util)
           
 
Methods inherited from class net.sf.mmm.util.nls.base.AbstractNlsFormatterPlugin
toString
 
Methods inherited from class net.sf.mmm.util.nls.base.AbstractNlsFormatter
format
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractLoggableComponent
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
 
Methods inherited from interface net.sf.mmm.util.nls.api.NlsFormatter
format
 

Field Detail

iso8601Util

private Iso8601Util iso8601Util
See Also:
format(Calendar, Locale, Appendable)
Constructor Detail

AbstractNlsFormatterDateIso8601

public AbstractNlsFormatterDateIso8601()
The constructor.


AbstractNlsFormatterDateIso8601

public AbstractNlsFormatterDateIso8601(Iso8601Util iso8601Util)
The constructor.

Parameters:
iso8601Util - is the Iso8601Util instance to use.
Method Detail

setIso8601Util

@Inject
public void setIso8601Util(Iso8601Util iso8601Util)
Parameters:
iso8601Util - is the iso8601Util to set

doInitialize

protected void doInitialize()
This method performs the actual initialization. It is called when AbstractComponent.initialize() is invoked for the first time.
ATTENTION:
When you override this method from a sub-class you need to do a super.AbstractComponent.doInitialize().

Overrides:
doInitialize in class AbstractLoggableComponent

format

protected void format(Calendar calendar,
                      Locale locale,
                      Appendable buffer)
This method formats the given calendar.

Parameters:
calendar - is the calendar to format.
locale - is the locale used for localized formatting.
buffer - is where to append the formatted calendar.

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.

format

public void format(Object object,
                   Locale locale,
                   Map<String,Object> arguments,
                   NlsTemplateResolver resolver,
                   Appendable buffer)
            throws IOException
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.
Throws:
IOException - if the given Appendable caused such exception.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.