|
||||||||||
| 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
public abstract class AbstractNlsMessage
This is the abstract base implementation of NlsMessage.
You should extend this class rather than directly implementing the
NlsMessage interface to gain compatibility with further releases.
| Field Summary | |
|---|---|
protected static Locale |
LOCALE_ROOT
Locale.ROOT is only available since java 6. |
| 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 | |
|---|---|
AbstractNlsMessage()
The constructor. |
|
| Method Summary | |
|---|---|
Object |
getArgument(int index)
Deprecated. use NlsMessage.getArgument(String) |
int |
getArgumentCount()
This method gets the number of language independent arguments of this exception. |
String |
getLocalizedMessage()
This method tries to get the localized message as string. |
String |
getLocalizedMessage(Locale locale)
This method tries to get the localized message as string. |
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()
|
| 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 |
|---|
getArgument, getInternationalizedMessage, getLocalizedMessage |
| Field Detail |
|---|
protected static final Locale LOCALE_ROOT
| Constructor Detail |
|---|
public AbstractNlsMessage()
| Method Detail |
|---|
@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()
translator is specified, the implementation may
try its best to do the translation on its own according to the callers
locale. Therefore this method has to do some magic
behind the scenes. This may only work if you follow specific rules of the
implementation of this interface. If this fails or is NOT supported, the
untranslated message should be used.NlsMessage.getLocalizedMessage(Locale, NlsTemplateResolver) instead.
getLocalizedMessage in interface NlsMessagepublic String getLocalizedMessage(Locale locale)
translator is specified, the implementation may
try its best to do the translation on its own according to the callers
locale. Therefore this method has to do some magic
behind the scenes. This may only work if you follow specific rules of the
implementation of this interface. If this fails or is NOT supported, the
untranslated message should be used.NlsMessage.getLocalizedMessage(Locale, NlsTemplateResolver) instead.
getLocalizedMessage in interface NlsMessagelocale - is the locale to translate 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()
getMessage in interface NlsMessageNlsMessage.getLocalizedMessage(Locale, NlsTemplateResolver)public NlsMessage toNlsMessage()
Object.toString() with native
language support.
toNlsMessage in interface NlsObjectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||