public final class ErrorTranslatorImpl extends Object implements ErrorTranslator
| Constructor and Description |
|---|
ErrorTranslatorImpl(String... errorFileNames) |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
doTranslation(List<String> errorMsg,
boolean changeIfNotFound,
Locale locale) |
boolean |
IsDynamicVariable(String strMessage)
returns true if the specified strMessage is in the format: "$variable-name variable-value", false otherwise.
|
List<String> |
ResolveMessages(List<String> translatedMessages)
Replacing variables ('${...}') within translatedMessages with their values ('$key value') that are also within
translatedMessages.
|
List<String> |
TranslateErrorText(List<String> errorMsg)
Translates and resolves errors from error types.
|
List<String> |
TranslateErrorText(List<String> errorMsg,
boolean changeIfNotFound)
Translate errors from error types.
|
List<String> |
TranslateErrorText(List<String> errorMsg,
Locale locale)
Translates and resolves errors from error types.
|
String |
TranslateErrorTextSingle(String errorMsg)
Translates a single error message.
|
String |
TranslateErrorTextSingle(String errorMsg,
boolean changeIfNotFound)
Translates a single error message.
|
String |
TranslateErrorTextSingle(String errorMsg,
Locale locale)
Translates a single error message.
|
List<String> |
TranslateMessages(List<String> errorMsg,
boolean changeIfNotFound) |
public ErrorTranslatorImpl(String... errorFileNames)
public final List<String> TranslateErrorText(List<String> errorMsg, boolean changeIfNotFound)
ErrorTranslatorTranslateErrorText in interface ErrorTranslatorerrorMsg - messages to be translatedchangeIfNotFound - If true: if message key is not found in the resource, return a beautified key. If false, returned
unfound key as is.public List<String> TranslateErrorText(List<String> errorMsg)
ErrorTranslatorTranslateErrorText in interface ErrorTranslatorerrorMsg - messages to be translatedpublic List<String> TranslateErrorText(List<String> errorMsg, Locale locale)
ErrorTranslatorTranslateErrorText in interface ErrorTranslatorerrorMsg - messages to be translatedlocale - the locale to translate intopublic final List<String> TranslateMessages(List<String> errorMsg, boolean changeIfNotFound)
TranslateMessages in interface ErrorTranslatorpublic final List<String> doTranslation(List<String> errorMsg, boolean changeIfNotFound, Locale locale)
public final boolean IsDynamicVariable(String strMessage)
ErrorTranslatorIsDynamicVariable in interface ErrorTranslatorstrMessage - the string that may be a dynamic variable.public final String TranslateErrorTextSingle(String errorMsg, boolean changeIfNotFound)
ErrorTranslatorTranslateErrorTextSingle in interface ErrorTranslatorerrorMsg - the message to be translatedchangeIfNotFound - If true: if message key is not found in the resource, return a beautified key. If false, returned
unfound key as is.public String TranslateErrorTextSingle(String errorMsg, Locale locale)
ErrorTranslatorTranslateErrorTextSingle in interface ErrorTranslatorerrorMsg - the message to translatelocale - the locale to translate intopublic final String TranslateErrorTextSingle(String errorMsg)
ErrorTranslatorTranslateErrorTextSingle in interface ErrorTranslatorerrorMsg - the message to translatepublic final List<String> ResolveMessages(List<String> translatedMessages)
ErrorTranslatorResolveMessages in interface ErrorTranslatorCopyright © 2012. All Rights Reserved.