Interface MessageContext
- All Known Subinterfaces:
StateManageableMessageContext
- All Known Implementing Classes:
DefaultMessageContext
public interface MessageContext
A context for recording and retrieving messages for display.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessage
(MessageResolver messageResolver) Add a new message to this context.void
Clear all messages added to this context.Message[]
Get all messages in this context.Message[]
getMessagesByCriteria
(MessageCriteria criteria) Get all messages that meet the given result criteria.Message[]
getMessagesBySource
(Object source) Get all messages in this context for the source provided.boolean
Returns true if there are error messages in this context.
-
Method Details
-
getAllMessages
Message[] getAllMessages()Get all messages in this context. The messages returned should be suitable for display as-is.- Returns:
- the messages
-
getMessagesBySource
Get all messages in this context for the source provided.- Parameters:
source
- the source associated with messages, or null for global messages- Returns:
- the source's messages
-
getMessagesByCriteria
Get all messages that meet the given result criteria.- Parameters:
criteria
- the message criteria
-
hasErrorMessages
boolean hasErrorMessages()Returns true if there are error messages in this context.- Returns:
- error messages
-
addMessage
Add a new message to this context.- Parameters:
messageResolver
- the resolver that will resolve the message to be added
-
clearMessages
void clearMessages()Clear all messages added to this context.
-