public abstract class AbstractNlsMessage extends Object implements NlsMessage
NlsMessage. NlsMessage interface to gain
compatibility with further releases.| Modifier and Type | Field and Description |
|---|---|
static Locale |
LOCALE_ROOT
Locale.ROOT is only available since java 6.
|
private static long |
serialVersionUID
UID for serialization.
|
LOCALIZATION_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| Constructor and Description |
|---|
AbstractNlsMessage()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getArgument(int index)
Deprecated.
|
int |
getArgumentCount()
This method gets the number of language independent arguments of this exception.
|
String |
getLocalizedMessage()
|
String |
getLocalizedMessage(Locale locale)
This method gets the message localized to the given
Locale as string. |
void |
getLocalizedMessage(Locale locale,
Appendable buffer)
This method writes the localized message to the given
buffer. |
String |
getLocalizedMessage(Locale locale,
NlsTemplateResolver resolver)
This method gets the localized message as string.
|
String |
getMessage()
This method gets the untranslated message (default language should be English) with arguments filled in.
|
NlsMessage |
toNlsMessage()
This method is the equivalent to
Object.toString() with native language support. |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetArgument, getInternationalizedMessage, getLocalizedMessageprivate static final long serialVersionUID
public static final Locale LOCALE_ROOT
@Deprecated public Object getArgument(int index)
NlsMessage.getArgument(String)Argument for the given index.getArgument in interface NlsMessageindex - is the index of the requested argument.null if no such argument exists.public int getArgumentCount()
getArgumentCount in interface NlsMessagepublic String getLocalizedMessage()
default
Locale. NlsMessage.getLocalizedMessage(Locale) instead.getLocalizedMessage in interface NlsMessagepublic String getLocalizedMessage(Locale locale)
Locale as string. If this fails for whatever
reason, the untranslated message will be returned as fallback.getLocalizedMessage in interface NlsMessagelocale - is the locale to translate to.net.sf.mmm.util.nls.apipublic void getLocalizedMessage(Locale locale, Appendable buffer)
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.getLocalizedMessage in interface NlsMessagelocale - is the locale to translate to.buffer - is the buffer where to write the message to.public String getLocalizedMessage(Locale locale, NlsTemplateResolver resolver)
getLocalizedMessage in interface NlsMessagelocale - is the locale to translate to.resolver - is used to translate the message.NlsMessage.getLocalizedMessage(Locale, NlsTemplateResolver, Appendable)public String getMessage()
NlsMessage.getLocalizedMessage(Locale) instead of this method.getMessage in interface NlsMessageNlsMessage.getLocalizedMessage(Locale, NlsTemplateResolver)public NlsMessage toNlsMessage()
Object.toString() with native language support.toNlsMessage in interface NlsObjectCopyright © 2001–2015 mmm-Team. All rights reserved.