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)
ErrorTranslator
TranslateErrorText
in interface ErrorTranslator
errorMsg
- 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)
ErrorTranslator
TranslateErrorText
in interface ErrorTranslator
errorMsg
- messages to be translatedpublic List<String> TranslateErrorText(List<String> errorMsg, Locale locale)
ErrorTranslator
TranslateErrorText
in interface ErrorTranslator
errorMsg
- messages to be translatedlocale
- the locale to translate intopublic final List<String> TranslateMessages(List<String> errorMsg, boolean changeIfNotFound)
TranslateMessages
in interface ErrorTranslator
public final List<String> doTranslation(List<String> errorMsg, boolean changeIfNotFound, Locale locale)
public final boolean IsDynamicVariable(String strMessage)
ErrorTranslator
IsDynamicVariable
in interface ErrorTranslator
strMessage
- the string that may be a dynamic variable.public final String TranslateErrorTextSingle(String errorMsg, boolean changeIfNotFound)
ErrorTranslator
TranslateErrorTextSingle
in interface ErrorTranslator
errorMsg
- 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)
ErrorTranslator
TranslateErrorTextSingle
in interface ErrorTranslator
errorMsg
- the message to translatelocale
- the locale to translate intopublic final String TranslateErrorTextSingle(String errorMsg)
ErrorTranslator
TranslateErrorTextSingle
in interface ErrorTranslator
errorMsg
- the message to translatepublic final List<String> ResolveMessages(List<String> translatedMessages)
ErrorTranslator
ResolveMessages
in interface ErrorTranslator
Copyright © 2012. All Rights Reserved.