| java.lang.Object org.castor.util.Messages
Messages | final public class Messages (Code) | | I18N message formatting class. A static factory for obtaining
messages and formatting messages with arguments.
The resource file org.exolab.castor.util.resources.messages
contains a list of all the messages in English. Additional resource
files can be added for other languages and locales by placing them
in the same package with a language/locale prefix. See the I18N
documentation and use of resource bundles in the JDK docs.
author: Assaf Arkin author: Ralf Joachim version: $Revision: 6907 $ $Date: 2006-04-10 16:39:24 -0600 (Mon, 10 Apr 2006) $ since: 1.0.1 |
Field Summary | |
final public static String | RESOURCE_NAME The name of the resource holding all the messages in the English
language. |
Method Summary | |
public static String | format(String message, Object arg1) Format the named message using a single argument and return the
full message text. | public static String | format(String message, Object arg1, Object arg2) Format the named message using two argument and return the
full message text. | public static String | format(String message, Object arg1, Object arg2, Object arg3) Format the named message using three argument and return the
full message text. | public static String | format(String message, Object[] args) Format the named message using any number of arguments and return the
full message text. | public static String | message(String message) Return the text of the named message without formatting. | public static void | setDefaultLocale() Set the default locale to use for loading messages. | public static void | setLocale(Locale locale) Set the locale to use for loading messages. |
RESOURCE_NAME | final public static String RESOURCE_NAME(Code) | | The name of the resource holding all the messages in the English
language. Resources for other languages and locales use the same
name with a language/locale prefix.
|
format | public static String format(String message, Object arg1)(Code) | | Format the named message using a single argument and return the
full message text.
Parameters: message - The message name Parameters: arg1 - The first argument The full message text |
format | public static String format(String message, Object arg1, Object arg2)(Code) | | Format the named message using two argument and return the
full message text.
Parameters: message - The message name Parameters: arg1 - The first argument Parameters: arg2 - The second argument The full message text |
format | public static String format(String message, Object arg1, Object arg2, Object arg3)(Code) | | Format the named message using three argument and return the
full message text.
Parameters: message - The message name Parameters: arg1 - The first argument Parameters: arg2 - The second argument Parameters: arg3 - The third argument The full message text |
format | public static String format(String message, Object[] args)(Code) | | Format the named message using any number of arguments and return the
full message text.
Parameters: message - The message name Parameters: args - Argument list The full message text |
message | public static String message(String message)(Code) | | Return the text of the named message without formatting.
Parameters: message - The message name The full message text |
setDefaultLocale | public static void setDefaultLocale()(Code) | | Set the default locale to use for loading messages. Calling this method
will reload all the messages based on the new locale name.
|
setLocale | public static void setLocale(Locale locale)(Code) | | Set the locale to use for loading messages. Calling this method
will reload all the messages based on the new locale name.
Parameters: locale - the locale for which a resource bundle is desired. |
|
|