org.exolab.castor.util
Class Messages
java.lang.Object
org.exolab.castor.util.Messages
public class Messages
extends java.lang.Object
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.
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:09:06 $
static String | ResourceName - The name of the resource holding all the messages in the English
language.
|
static String | format(String message, Object arg1) - Format the named message using a single argument and return the
full message text.
|
static String | format(String message, Object arg1, Object arg2) - Format the named message using two argument and return the
full message text.
|
static String | format(String message, Object arg1, Object arg2, Object arg3) - Format the named message using three argument and return the
full message text.
|
static String | format(String message, Object[] args) - Format the named message using any number of arguments and return the
full message text.
|
static String | message(String message) - Return the text of the named message without formatting.
|
static void | setLocale(Locale locale) - Set the locale to use for loading messages.
|
ResourceName
public static final String ResourceName
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)
Format the named message using a single argument and return the
full message text.
message
- The message namearg1
- The first argument
format
public static String format(String message,
Object arg1,
Object arg2)
Format the named message using two argument and return the
full message text.
message
- The message namearg1
- The first argumentarg2
- The second argument
format
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.
message
- The message namearg1
- The first argumentarg2
- The second argumentarg3
- The third argument
format
public static String format(String message,
Object[] args)
Format the named message using any number of arguments and return the
full message text.
message
- The message nameargs
- Argument list
message
public static String message(String message)
Return the text of the named message without formatting.
message
- The message name
setLocale
public static void setLocale(Locale locale)
Set the locale to use for loading messages. Calling this method
will reload all the messages based on the new locale name.
Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com