|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.util.swing.messaging.MessageFactoryHolder
public class MessageFactoryHolder
A helper class for MessageManager.
This class integrates all registered MessageFactories and organize their handling
(registering, priorising, etc.).
It implements MessageFactory interface to be use as one by MessageManager.
This will normally not directly used by other classes than MessageManager.
Method Summary | |
---|---|
static void |
addMessageFactory(MessageFactory aFactory)
Adds a given MessageFactory. |
boolean |
containsKey(String key)
Returns whether given key has a value in one of the registered resources. |
Message |
createMessage(String messageKey)
Create a Message specified by given key. |
Message |
createMessage(String messageKey,
Object[] parameters,
Throwable e)
Create a Message specified by given key and additionally parameters. |
Message |
createMessage(String messageKey,
Throwable e)
|
static MessageFactoryHolder |
getInstance()
returns an instance of this class |
Collection |
getSuppressableMessages()
Returns a Collection of Message identifiers of messages that are
allowed to be suppressed by the user. |
static void |
removeMessageFactory(MessageFactory aFactory)
Removes a given Message Factory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static MessageFactoryHolder getInstance()
public static void addMessageFactory(MessageFactory aFactory)
aFactory
- public static void removeMessageFactory(MessageFactory aFactory)
aFactory
- resource to be removedpublic boolean containsKey(String key)
MessageFactory
containsKey
in interface MessageFactory
key
- the key to look up in the resource bundle
MessageFactory.containsKey(String)
public Message createMessage(String messageKey)
MessageFactory
createMessage
in interface MessageFactory
MessageFactory.createMessage(String)
public Message createMessage(String messageKey, Throwable e)
MessageFactory.createMessage(String)
public Message createMessage(String messageKey, Object[] parameters, Throwable e)
MessageFactory
createMessage
in interface MessageFactory
messageKey
- identifier keyparameters
- replacing the placeholders {0}, {1}... in the body text.e
- an Exception belonging to the message
MessageFactory.createMessage(String, Object[], Throwable)
public Collection getSuppressableMessages()
Message
identifiers of messages that are
allowed to be suppressed by the user.
getSuppressableMessages
in interface MessageFactory
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |