net.sf.mmm.util.nls.base
Class NlsFormatterMap

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.NlsFormatterMap
Direct Known Subclasses:
ConfiguredNlsFormatterMap

public class NlsFormatterMap
extends AbstractLoggableComponent

This class is like a Map to register and retrieve NlsFormatters.
ATTENTION:
The default formatter is NOT stored in this map.

Since:
1.0.1
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
See Also:
ConfiguredNlsFormatterMap

Field Summary
private  Map<String,Map<String,NlsFormatter<?>>> builders
           
 
Constructor Summary
NlsFormatterMap()
          The constructor.
 
Method Summary
 NlsFormatter<?> getFormatter(String formatType, String formatStyle)
           
 NlsFormatter<?> registerFormatter(NlsFormatter<?> formatter, String formatType, String formatStyle)
          This method registers the given formatBuilder.
 NlsFormatter<?> registerFormatter(NlsFormatterPlugin<?> formatter)
          This method registers the given formatBuilder.
 
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, toString, wait, wait, wait
 

Field Detail

builders

private final Map<String,Map<String,NlsFormatter<?>>> builders
See Also:
getFormatter(String, String)
Constructor Detail

NlsFormatterMap

public NlsFormatterMap()
The constructor.

Method Detail

registerFormatter

public NlsFormatter<?> registerFormatter(NlsFormatterPlugin<?> formatter)
This method registers the given formatBuilder.

Parameters:
formatter - is the NlsFormatterPlugin to register.
Returns:
the NlsFormatter that was registered for the given type and style and is now replaced by the given formatter or null if no NlsFormatter was replaced.

registerFormatter

public NlsFormatter<?> registerFormatter(NlsFormatter<?> formatter,
                                         String formatType,
                                         String formatStyle)
This method registers the given formatBuilder.

Parameters:
formatter - is the formatter to register.
formatType - is the type to be formatted.
formatStyle - is the style defining details of formatting. May be null for default formatter.
Returns:
the NlsFormatter that was registered for the given formatType and formatStyle and is now replaced by the given formatter or null if no NlsFormatter was replaced.

getFormatter

public NlsFormatter<?> getFormatter(String formatType,
                                    String formatStyle)
Parameters:
formatType - is the type to be formatted.
formatStyle - is the style defining details of formatting. May be null for default formatter of the given formatType.
Returns:
the according NlsFormatter instance or null if NO such NlsFormatter is registered .
See Also:
NlsFormatterManager.getFormatter(String, String)


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