public final class LocalizedMessage extends Object implements Comparable<LocalizedMessage>, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
LocalizedMessage.Utf8Control
Custom ResourceBundle.Control implementation which allows explicitly read
the properties files as UTF-8.
|
Constructor and Description |
---|
LocalizedMessage(int lineNo,
int columnNo,
int columnCharIndex,
int tokenType,
String bundle,
String key,
Object[] args,
SeverityLevel severityLevel,
String moduleId,
Class<?> sourceClass,
String customMessage)
Creates a new
LocalizedMessage instance. |
LocalizedMessage(int lineNo,
int columnNo,
int tokenType,
String bundle,
String key,
Object[] args,
SeverityLevel severityLevel,
String moduleId,
Class<?> sourceClass,
String customMessage)
Creates a new
LocalizedMessage instance. |
LocalizedMessage(int lineNo,
int columnNo,
String bundle,
String key,
Object[] args,
SeverityLevel severityLevel,
String moduleId,
Class<?> sourceClass,
String customMessage)
Creates a new
LocalizedMessage instance. |
LocalizedMessage(int lineNo,
int columnNo,
String bundle,
String key,
Object[] args,
String moduleId,
Class<?> sourceClass,
String customMessage)
Creates a new
LocalizedMessage instance. |
LocalizedMessage(int lineNo,
String bundle,
String key,
Object[] args,
SeverityLevel severityLevel,
String moduleId,
Class<?> sourceClass,
String customMessage)
Creates a new
LocalizedMessage instance. |
LocalizedMessage(int lineNo,
String bundle,
String key,
Object[] args,
String moduleId,
Class<?> sourceClass,
String customMessage)
Creates a new
LocalizedMessage instance. |
Modifier and Type | Method and Description |
---|---|
static void |
clearCache()
Clears the cache.
|
int |
compareTo(LocalizedMessage other) |
boolean |
equals(Object object) |
int |
getColumnCharIndex()
Gets the column char index.
|
int |
getColumnNo()
Gets the column number.
|
String |
getKey()
Returns the message key to locate the translation, can also be used
in IDE plugins to map error messages to corrective actions.
|
int |
getLineNo()
Gets the line number.
|
String |
getMessage()
Gets the translated message.
|
String |
getModuleId()
Returns id of module.
|
SeverityLevel |
getSeverityLevel()
Gets the severity level.
|
String |
getSourceName()
Gets the name of the source for this LocalizedMessage.
|
int |
getTokenType()
Gets the token type.
|
int |
hashCode() |
static void |
setLocale(Locale locale)
Sets a locale to use for localization.
|
public LocalizedMessage(int lineNo, int columnNo, int columnCharIndex, int tokenType, String bundle, String key, Object[] args, SeverityLevel severityLevel, String moduleId, Class<?> sourceClass, String customMessage)
LocalizedMessage
instance.lineNo
- line number associated with the messagecolumnNo
- column number associated with the messagecolumnCharIndex
- column char index associated with the messagetokenType
- token type of the event associated with the message. See TokenTypes
bundle
- resource bundle namekey
- the key to locate the translationargs
- arguments for the translationseverityLevel
- severity level for the messagemoduleId
- the id of the module the message is associated withsourceClass
- the Class that is the source of the messagecustomMessage
- optional custom message overriding the defaultpublic LocalizedMessage(int lineNo, int columnNo, int tokenType, String bundle, String key, Object[] args, SeverityLevel severityLevel, String moduleId, Class<?> sourceClass, String customMessage)
LocalizedMessage
instance.lineNo
- line number associated with the messagecolumnNo
- column number associated with the messagetokenType
- token type of the event associated with the message. See TokenTypes
bundle
- resource bundle namekey
- the key to locate the translationargs
- arguments for the translationseverityLevel
- severity level for the messagemoduleId
- the id of the module the message is associated withsourceClass
- the Class that is the source of the messagecustomMessage
- optional custom message overriding the defaultpublic LocalizedMessage(int lineNo, int columnNo, String bundle, String key, Object[] args, SeverityLevel severityLevel, String moduleId, Class<?> sourceClass, String customMessage)
LocalizedMessage
instance.lineNo
- line number associated with the messagecolumnNo
- column number associated with the messagebundle
- resource bundle namekey
- the key to locate the translationargs
- arguments for the translationseverityLevel
- severity level for the messagemoduleId
- the id of the module the message is associated withsourceClass
- the Class that is the source of the messagecustomMessage
- optional custom message overriding the defaultpublic LocalizedMessage(int lineNo, int columnNo, String bundle, String key, Object[] args, String moduleId, Class<?> sourceClass, String customMessage)
LocalizedMessage
instance.lineNo
- line number associated with the messagecolumnNo
- column number associated with the messagebundle
- resource bundle namekey
- the key to locate the translationargs
- arguments for the translationmoduleId
- the id of the module the message is associated withsourceClass
- the Class that is the source of the messagecustomMessage
- optional custom message overriding the defaultpublic LocalizedMessage(int lineNo, String bundle, String key, Object[] args, SeverityLevel severityLevel, String moduleId, Class<?> sourceClass, String customMessage)
LocalizedMessage
instance.lineNo
- line number associated with the messagebundle
- resource bundle namekey
- the key to locate the translationargs
- arguments for the translationseverityLevel
- severity level for the messagemoduleId
- the id of the module the message is associated withsourceClass
- the source class for the messagecustomMessage
- optional custom message overriding the defaultpublic LocalizedMessage(int lineNo, String bundle, String key, Object[] args, String moduleId, Class<?> sourceClass, String customMessage)
LocalizedMessage
instance. The column number
defaults to 0.lineNo
- line number associated with the messagebundle
- name of a resource bundle that contains error messageskey
- the key to locate the translationargs
- arguments for the translationmoduleId
- the id of the module the message is associated withsourceClass
- the name of the source for the messagecustomMessage
- optional custom message overriding the defaultpublic static void clearCache()
public String getMessage()
public int getLineNo()
public int getColumnNo()
public int getColumnCharIndex()
public int getTokenType()
public SeverityLevel getSeverityLevel()
public String getModuleId()
public String getKey()
public String getSourceName()
public static void setLocale(Locale locale)
locale
- the locale to use for localizationpublic int compareTo(LocalizedMessage other)
compareTo
in interface Comparable<LocalizedMessage>
Copyright © 2001–2018. All rights reserved.