public class ComposedNlsMessage extends AbstractNlsMessage
NlsMessage for composing other objects or
messages.| Modifier and Type | Field and Description |
|---|---|
private Object[] |
arguments |
private static long |
serialVersionUID
UID for serialization.
|
LOCALE_ROOTLOCALIZATION_FAILURE_PREFIXKEY_ANNOTATION, KEY_ARGUMENT, KEY_CAPACITY, KEY_CONTAINER, KEY_DEFAULT, KEY_DIRECTORY, KEY_ERROR, KEY_EXISTING, KEY_EXPECTED, 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_USER, KEY_VALUE| Modifier | Constructor and Description |
|---|---|
protected |
ComposedNlsMessage()
The constructor for de-serialization in GWT.
|
|
ComposedNlsMessage(Object[] arguments)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getMessage, toNlsMessage, toStringprivate static final long serialVersionUID
private Object[] arguments
getArgument(int)protected ComposedNlsMessage()
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,
NlsMessage.getArgument(String),
MessageFormatpublic Object getArgument(String key)
key.key - is the name of the requested argument.null if NOT defined.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.RuntimeIoExceptionCopyright © 2001–2015 mmm-Team. All rights reserved.