public final class MessageLocalization extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getComposedMessage(String key,
int p1)
Get a message with one parameter as an primitive int.
|
static String |
getComposedMessage(String key,
Object... param)
Get a message with param.length parameters or none if param is null.
|
static String |
getMessage(String key)
Get a message without parameters.
|
static String |
getMessage(String key,
boolean useDefaultLanguageIfMessageNotFound) |
static boolean |
setLanguage(String language,
String country)
Sets the language to be used globally for the error messages.
|
static void |
setMessages(Reader r)
Sets the error messages directly from a Reader.
|
public static String getMessage(String key)
key
- the key to the messagepublic static String getComposedMessage(String key, int p1)
key
- the key to the messagep1
- the parameterpublic static String getComposedMessage(String key, Object... param)
key
- the key to the messageparam
- array of parameter objects, (toString is used to add it to the message)public static boolean setLanguage(String language, String country) throws IOException
language
- the languagecountry
- the countryIOException
- on errorpublic static void setMessages(Reader r) throws IOException
r
- the ReaderIOException
- on errorCopyright © 2020. All rights reserved.