public abstract class MessageCode extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
MessageCode.DynamicMessageCode
Allows to declare a non-internationalized message.
|
static class |
MessageCode.MessageCodeFromField
Allows to declare an internationalized message as a Class field.
|
Constructor and Description |
---|
MessageCode() |
Modifier and Type | Method and Description |
---|---|
String |
getErrorCode()
Error code.
|
abstract String |
getMessage()
Directly returns message from bundle.
|
abstract String |
getMessage(Object... args)
Returns formatted message from bundle.
|
static void |
initMessages(Class<?> clazz,
String bundleName,
String keyPrefix)
Initializes all
MessageCode.MessageCodeFromField public static final fields in a Class. |
protected static ResourceBundle |
loadBundle(String bundleName) |
abstract String |
name()
Name for this MessageCode
|
String |
toString()
Returns name.
|
public static void initMessages(Class<?> clazz, String bundleName, String keyPrefix) throws UtilsException
MessageCode.MessageCodeFromField
public static final fields in a Class.UtilsException
protected static ResourceBundle loadBundle(String bundleName) throws UtilsException
UtilsException
public abstract String name()
public abstract String getMessage()
public String getErrorCode()