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 |
LOCALE_ROOT
LOCALIZATION_FAILURE_PREFIX
KEY_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 value 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 what is the actual message template for the
root
locale without resolving its NlsArgument s. |
void |
getLocalizedMessage(Locale locale,
NlsTemplateResolver resolver,
Appendable buffer)
This method writes the localized message to the given
buffer . |
getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getMessage, toNlsMessage, toString
private static final long serialVersionUID
private Object[] arguments
protected ComposedNlsMessage()
public Object getArgument(int index)
AbstractNlsMessage
Argument
for the given index.getArgument
in interface NlsMessage
getArgument
in class AbstractNlsMessage
index
- is the index of the requested argument.null
if no such argument exists.public int getArgumentCount()
NlsMessage
getArgumentCount
in interface NlsMessage
getArgumentCount
in class AbstractNlsMessage
public String getInternationalizedMessage()
NlsMessage
root
locale
without resolving its NlsArgument
s."Welcome {name}!"
).NlsMessage
,
NlsMessage.getArgument(String)
,
MessageFormat
public Object getArgument(String key)
NlsMessage
key
.key
- is the name of the requested argument.null
if NOT defined.NlsArgument
public void getLocalizedMessage(Locale locale, NlsTemplateResolver resolver, Appendable buffer) throws RuntimeIoException
NlsMessage
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
Copyright © 2001–2016 mmm-Team. All rights reserved.