| java.lang.Object org.zkoss.mesg.Messages
Messages | public class Messages implements MessageConst(Code) | | The message manager.
This class manages how an message is retrieved based on the message code
and the locale.
Note: unlike MessageFormat's default behavior, all null objects
are treated as an empty string rather than "null".
author: tomyeh |
Inner Class :public static interface Formatter | |
Constructor Summary | |
protected | Messages() |
Method Summary | |
final public static String | get(int code) Gets a message based on the specified code without formating arugments. | final public static String | get(int code, Object fmtArg) Gets a message based on the locale of current user with
ONE format-argument. | final public static String | get(int code, Object[] fmtArgs) Gets a message based on the locale of current user. | public static String | get(int code, Object[] fmtArgs, Locale locale) Gets a message based on the specified code. | public static Formatter | getFormatter() Returns the formatter used by
Messages.get(int,Object[],Locale) ,
or null if not set. | final public static int | getType(int code) Gets the message type of the specified code. | public static void | setFormatter(Formatter fmt) Sets the formatter used by
Messages.get(int,Object[],Locale) . |
Messages | protected Messages()(Code) | | |
get | final public static String get(int code)(Code) | | Gets a message based on the specified code without formating arugments.
Equivalent to get(code, null).
|
get | final public static String get(int code, Object fmtArg)(Code) | | Gets a message based on the locale of current user with
ONE format-argument.
|
get | final public static String get(int code, Object[] fmtArgs)(Code) | | Gets a message based on the locale of current user.
Equivalent to get(code, fmtArgs, current_locale).
The current_locale argument depends on the implementation.
|
get | public static String get(int code, Object[] fmtArgs, Locale locale)(Code) | | Gets a message based on the specified code. If not found, returns
an error message to denote it.
If fmtArgs is not null,
org.zkoss.text.MessageFormats.format is called to format
the message. However, unlike MessageFormat's default behavior,
all null objects are treated as an empty string rather than "null".
It also recognizes
org.zkoss.lang.Objects.UNKNOWN .
Parameters: code - the code Parameters: fmtArgs - the argument lists to format the message Parameters: locale - the locale of the message to load the message; never be null |
getType | final public static int getType(int code)(Code) | | Gets the message type of the specified code.
|
|
|