|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.amattioli.workstate.exceptions.MessageBundle
public class MessageBundle
Abstract class for the rapid development of message bundle retrieving classes.
Messages can contains place-holders for parameter substitution.
Place holder syntax is the same as for MessageFormat: "{0}" is the
first parameter, "{1}" is the second one and so on.
| Constructor Summary | |
|---|---|
MessageBundle(ResourceBundle messages)
Construct a MessageBundle using the given ResourceBundle. |
|
MessageBundle(String bundleName)
Construct a MessageBundle using the ResourceBundle with
the given name. |
|
MessageBundle(String bundleName,
Locale locale)
Construct a MessageBundle using the ResourceBundle with
the given name and the given Locale. |
|
| Method Summary | |
|---|---|
String |
getErrorMessage(KeyedMessage message)
|
String |
getErrorMessage(String key)
Return the message with the given key |
String |
getErrorMessage(String key,
String... args)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MessageBundle(ResourceBundle messages)
MessageBundle using the given ResourceBundle.
messages - the ResourceBundle used to retrieve messages.public MessageBundle(String bundleName)
MessageBundle using the ResourceBundle with
the given name.
bundleName - the full qualified name of the ResourceBundle
public MessageBundle(String bundleName,
Locale locale)
MessageBundle using the ResourceBundle with
the given name and the given Locale.
bundleName - the full qualified name of the ResourceBundlelocale - the locale for the messages| Method Detail |
|---|
public String getErrorMessage(String key)
key - the message key
MissingResourceException - if there is no resource in the bundle
with the given key
public String getErrorMessage(String key,
String... args)
public String getErrorMessage(KeyedMessage message)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||