public final class Messages extends Object
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.
Modifier and Type | Field and Description |
---|---|
static String |
RESOURCE_NAME
The name of the resource holding all the messages in the English
language.
|
Modifier and Type | Method and Description |
---|---|
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[] args)
Format the named message using any number of arguments 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 |
message(String message)
Return the text of the named message without formatting.
|
static void |
setDefaultLocale()
Set the default locale to use for loading messages.
|
static void |
setLocale(Locale locale)
Set the locale to use for loading messages.
|
public static final String RESOURCE_NAME
public static void setDefaultLocale()
public static void setLocale(Locale locale)
locale
- the locale for which a resource bundle is desired.public static String format(String message, Object arg1)
message
- The message namearg1
- The first argumentpublic static String format(String message, Object arg1, Object arg2)
message
- The message namearg1
- The first argumentarg2
- The second argumentpublic static String format(String message, Object arg1, Object arg2, Object arg3)
message
- The message namearg1
- The first argumentarg2
- The second argumentarg3
- The third argumentpublic static String format(String message, Object[] args)
message
- The message nameargs
- Argument listCopyright © 2015. All rights reserved.