public class NlsFormatterType extends AbstractNlsFormatterPlugin<Object>
NlsFormatter
that formats Type
s.Modifier and Type | Class and Description |
---|---|
private class |
NlsFormatterType.ClassFormatter
This inner class is used to format
Class es. |
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) |
toString
format
createLogger, getLogger
doInitialized, getInitializationState, initialize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
format
private 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 AbstractLoggableComponent
public 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–2014 mmm-Team. All rights reserved.