net.sf.mmm.util.nls.base
Class AbstractNlsTemplate
java.lang.Object
net.sf.mmm.util.component.base.AbstractLoggableObject
net.sf.mmm.util.nls.base.AbstractNlsTemplate
- All Implemented Interfaces:
- NlsTemplate
- Direct Known Subclasses:
- NlsTemplateImpl
public abstract class AbstractNlsTemplate
- extends AbstractLoggableObject
- implements NlsTemplate
This is the abstract base implementation of the NlsTemplate
interface.
- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractNlsTemplate
public AbstractNlsTemplate()
- The constructor.
createFormatter
protected NlsMessageFormatter createFormatter(String messageTemplate,
Locale locale,
NlsDependencies nlsDependencies)
- This method creates an
NlsMessageFormatter for the given
messageTemplate and locale.
- Parameters:
messageTemplate - is the template of the message for the given
locale.locale - is the locale to use. The implementation may ignore it here
because it is also supplied at
NlsMessageFormatter#format(Void, Locale, Map, NlsTemplateResolver)
. Anyhow it allows the implementation to do smart caching of the
parsed formatter in association with the locale.nlsDependencies - are the NlsDependencies.
- Returns:
- the formatter instance.
translate
public boolean translate(Locale locale,
Map<String,Object> arguments,
Appendable buffer,
NlsTemplateResolver resolver,
NlsDependencies nlsDependencies)
throws IOException
- This method behaves like
NlsTemplate.translate(Locale) but additionally fills
the given arguments into the translated message writing into
the given buffer.
- Specified by:
translate in interface NlsTemplate
- Parameters:
locale - is the locale to translate to.arguments - are the variable arguments to fill in the message.buffer - is the buffer where the translation will be appended to.resolver - is the NlsTemplateResolver.nlsDependencies - are the NlsDependencies.
- Returns:
true if the (translated) message has been appended to
the given messageBuffer or false if the
translation failed.
- Throws:
IOException - if the given Appendable caused such exception.
Copyright © 2001-2010 mmm-Team. All Rights Reserved.