|
||||||||||
| 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.BasicNlsMessage
public abstract class BasicNlsMessage
This is the abstract implementation of
NlsMessage with the basic features.
You should extend this class whenever suitable to implement
NlsMessage.
| Field Summary | |
|---|---|
private Map<String,Object> |
arguments
|
private String |
message
|
private NlsTemplate |
template
The message as NlsTemplate. |
| 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 | |
|---|---|
BasicNlsMessage(NlsTemplate template,
Map<String,Object> messageArguments)
The constructor. |
|
BasicNlsMessage(String internationalizedMessage,
Map<String,Object> messageArguments)
The constructor. |
|
| Method Summary | |
|---|---|
Object |
getArgument(String key)
This method gets the language independent argument for the given key. |
protected Map<String,Object> |
getArguments()
This method gets the message arguments. |
String |
getInternationalizedMessage()
This method gets the internationalized message that can be translated to a native
language. |
NlsTemplate |
getTemplate()
This method gets the NlsTemplate of this message. |
NlsTemplate |
getTemplate(NlsTemplateResolver resolver)
This method gets the NlsTemplate of this message. |
| Methods inherited from class net.sf.mmm.util.nls.base.AbstractNlsMessage |
|---|
getArgument, getArgumentCount, getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getMessage, toNlsMessage, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sf.mmm.util.nls.api.NlsMessage |
|---|
getLocalizedMessage |
| Field Detail |
|---|
private NlsTemplate template
message as NlsTemplate.
private String message
getInternationalizedMessage()private final Map<String,Object> arguments
getArgument(String)| Constructor Detail |
|---|
public BasicNlsMessage(NlsTemplate template,
Map<String,Object> messageArguments)
template - is the NlsTemplate for the
raw message.messageArguments - are the arguments
filled into the message after nationalization.
public BasicNlsMessage(String internationalizedMessage,
Map<String,Object> messageArguments)
internationalizedMessage - is the
internationalized message.messageArguments - are the arguments
filled into the message after nationalization.| Method Detail |
|---|
public Object getArgument(String key)
key.
key - is the name of the requested argument.
public 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),
MessageFormatprotected Map<String,Object> getArguments()
arguments.
Map with the arguments.public NlsTemplate getTemplate()
NlsTemplate of this message.
NlsTemplate or null if NOT yet
resolved.public NlsTemplate getTemplate(NlsTemplateResolver resolver)
NlsTemplate of this message.
resolver - is the NlsTemplateResolver used to
resolve the
NlsTemplate if NOT yet available.
NlsTemplate.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||