|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.nls.base.AbstractNlsMessage
net.sf.mmm.util.nls.base.ComposedNlsMessage
public class ComposedNlsMessage
This is an implementation of NlsMessage for
composing other objects or messages.
| Field Summary | |
|---|---|
private Object[] |
arguments
|
| Fields inherited from class net.sf.mmm.util.nls.base.AbstractNlsMessage |
|---|
LOCALE_ROOT |
| Fields inherited from interface net.sf.mmm.util.nls.api.NlsMessage |
|---|
LOCALIZATION_FAILURE_PREFIX |
| Fields inherited from interface net.sf.mmm.util.nls.api.NlsObject |
|---|
KEY_ANNOTATION, KEY_ARGUMENT, KEY_CAPACITY, KEY_DEFAULT, KEY_DIRECTORY, KEY_ERROR, KEY_FILE, KEY_FUNCTION, KEY_ID, KEY_KEY, KEY_LOCATION, KEY_MAX, KEY_MIN, KEY_MODE, KEY_NAME, KEY_OBJECT, KEY_OPERAND, KEY_OPERATION, KEY_OPTION, KEY_PATH, KEY_PROPERTY, KEY_QUERY, KEY_RESOURCE, KEY_SIZE, KEY_SOURCE, KEY_TARGET_TYPE, KEY_TITLE, KEY_TYPE, KEY_URI, KEY_VALUE |
| Constructor Summary | |
|---|---|
ComposedNlsMessage(Object[] arguments)
The constructor. |
|
| Method Summary | |
|---|---|
Object |
getArgument(int index)
This method gets the Argument for the given
index. |
Object |
getArgument(String key)
This method gets the language independent argument for the given key. |
int |
getArgumentCount()
This method gets the number of language independent arguments of this exception. |
String |
getInternationalizedMessage()
This method gets the internationalized message that can be translated to a native
language. |
void |
getLocalizedMessage(Locale locale,
NlsTemplateResolver resolver,
Appendable buffer)
This method writes the localized message to the given buffer. |
| Methods inherited from class net.sf.mmm.util.nls.base.AbstractNlsMessage |
|---|
getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getMessage, toNlsMessage, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Object[] arguments
getArgument(int)| Constructor Detail |
|---|
public ComposedNlsMessage(Object[] arguments)
arguments - are the arguments.| Method Detail |
|---|
public Object getArgument(int index)
Argument for the given
index.
getArgument in interface NlsMessagegetArgument in class AbstractNlsMessageindex - is the index of the requested argument.
null if no such
argument exists.public int getArgumentCount()
getArgumentCount in interface NlsMessagegetArgumentCount in class AbstractNlsMessagepublic String getInternationalizedMessage()
translated to a native
language. The language independent arguments are filled into the message
after the translation process. "Welcome {name}!" and there is
one argument that is the string "Joelle". The final result
will then be "Welcome Joelle!". If the message is translated
to German as "Willkommen {name}!" the final result will be
"Willkommen Joelle!".
NlsMessage.getArgument(String),
MessageFormatpublic Object getArgument(String key)
key.
key - is the name of the requested argument.
public void getLocalizedMessage(Locale locale,
NlsTemplateResolver resolver,
Appendable buffer)
throws RuntimeIoException
buffer. template that is
provided via the given resolver. If this fails, the
original message will be used. After
translation is done, the language independent arguments will be filled in
the translated message string according to the given locale.
locale - is the locale to translate to.resolver - is used to resolve the template required to translate the
internationalized message.buffer - is the buffer where to write the message to.
RuntimeIoException - if the given buffer produced an
IOException.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||