public class NlsFormatterType extends AbstractNlsFormatterPlugin<Object>
NlsFormatter that formats Types.| Modifier and Type | Class and Description |
|---|---|
private class |
NlsFormatterType.ClassFormatter
This inner class is used to format
Classes. |
| Modifier and Type | Field and Description |
|---|---|
private static Package |
PACKAGE_JAVA_LANG
The package
java.lang. |
private ReflectionUtil |
reflectionUtil |
private String |
style |
| Constructor and Description |
|---|
NlsFormatterType(String style)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInitialize()
This method performs the actual
initialization. |
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. |
protected ReflectionUtil |
getReflectionUtil() |
String |
getStyle()
This method gets the
style of this formatter. |
String |
getType()
This method gets the
type of
this formatter. |
void |
setReflectionUtil(ReflectionUtil reflectionUtil) |
toStringformatcreateLogger, getLoggerdoInitialized, getInitializationState, initializeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitformatprivate static final Package PACKAGE_JAVA_LANG
java.lang.private final String style
getStyle()private ReflectionUtil reflectionUtil
getReflectionUtil()public String getStyle()
style of this formatter. See STYLE_* constants of
NlsFormatterManager e.g.
NlsFormatterManager.STYLE_LONG.null for no style.public String getType()
type of
this formatter. See TYPE_* constants of NlsFormatterManager
e.g. NlsFormatterManager.TYPE_NUMBER.null for the
default formatter. If type is
null then also style needs to be null.protected ReflectionUtil getReflectionUtil()
@Inject public void setReflectionUtil(ReflectionUtil reflectionUtil)
reflectionUtil - is the reflectionUtil to setprotected void doInitialize()
initialization. It is called when
AbstractComponent.initialize() is invoked for the first time. super.AbstractComponent.doInitialize().doInitialize in class AbstractLoggableComponentpublic void format(Object object, Locale locale, Map<String,Object> arguments, NlsTemplateResolver resolver, Appendable buffer) throws IOException
object according to the given locale.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.IOException - if the given Appendable caused such exception.Copyright © 2001–2015 mmm-Team. All rights reserved.