nl.knowlogy.validation
Interface Messages

All Known Implementing Classes:
MessagesImpl

public interface Messages

A Messages is a message container,in which messages are stored during validating and is used to provide feedback about the validation.

Author:
Robert
See Also:
Message

Method Summary
 void addMessage(Message message)
          Stores an message in the messages.
 void addMessage(MessageType messageType, Object object, String messageCode)
           Stores and creates an Message in the messages, based on the give params.
 void addMessage(MessageType messageType, Object object, String messageCode, Object[] messageArgs, String defaultMessage)
          Add a message.
 void addMessage(MessageType messageType, Object object, String messageCode, String defaultMessage)
          Add a message.
 void addMessages(Messages messages)
          Adds messages.
 void addPropertyMessage(MessageType messageType, Object object, String propertyName, String messageCode)
          Add a message for a specific property of the object.
 void addPropertyMessage(MessageType messageType, Object object, String propertyName, String messageCode, Object[] messageArgs, String defaultMessage)
          Add a message for a specific property of the object.
 void addPropertyMessage(MessageType messageType, Object object, String propertyName, String messageCode, String defaultMessage)
          Add a message for a specific property of the object.
 void clear()
          Clears all messages in the container.
 void convertMessageCodes(ResourceBundle resourceBundle)
           
 String getMessage()
          Returns an overal messageMessage.
 Message getMessage(Object object, boolean objectLevelOnly)
           
 Message getMessage(Object object, String propertyName)
          Returns the first message associated with the given object and propertyName, if such a message is present else null.
 List getMessages()
           
 List getMessages(Object object, boolean objectLevelOnly)
           
 List getMessages(Object object, String propertyName)
          Returns a list of Message instances associated with the given object and propertyName, if such a message is present.
 int getNumberOfErrorMessages()
           
 int getNumberOfMessages()
          Returns the number of message's.
 int getNumberOfMessages(MessageType messageType)
          Returns the number of messages with a specific messagetype.
 

Method Detail

addMessage

void addMessage(Message message)
Stores an message in the messages.

Parameters:
message - message to add

addMessage

void addMessage(MessageType messageType,
                Object object,
                String messageCode)

Stores and creates an Message in the messages, based on the give params.

These messages are not bound to a specific property of the object.

Parameters:
messageType - type of the message
object - the rejected object
messageCode - message code, interpretable as message key

addMessage

void addMessage(MessageType messageType,
                Object object,
                String messageCode,
                String defaultMessage)
Add a message.

Parameters:
messageType - type of the message
messageCode - message code, interpretable as message key
defaultMessage - fallback default message

addMessage

void addMessage(MessageType messageType,
                Object object,
                String messageCode,
                Object[] messageArgs,
                String defaultMessage)
Add a message.

Parameters:
messageType - type of the message
messageCode - message code, interpretable as message key
messageArgs - message arguments, for argument binding via MessageFormat (can be null)
defaultMessage - fallback default message

addPropertyMessage

void addPropertyMessage(MessageType messageType,
                        Object object,
                        String propertyName,
                        String messageCode)
Add a message for a specific property of the object.

Parameters:
messageType - type of the message
propertyName - the property name
messageCode - message code, interpretable as message key

addPropertyMessage

void addPropertyMessage(MessageType messageType,
                        Object object,
                        String propertyName,
                        String messageCode,
                        String defaultMessage)
Add a message for a specific property of the object.

Parameters:
messageType - type of the message
propertyName - the field name
messageCode - message code, interpretable as message key
defaultMessage - fallback default message

addPropertyMessage

void addPropertyMessage(MessageType messageType,
                        Object object,
                        String propertyName,
                        String messageCode,
                        Object[] messageArgs,
                        String defaultMessage)
Add a message for a specific property of the object.

Parameters:
messageType - type of the message
propertyName - the property name
messageCode - message code, interpretable as message key
messageArgs - message arguments, for argument binding via MessageFormat (can be null)
defaultMessage - fallback default message

getNumberOfMessages

int getNumberOfMessages()
Returns the number of message's.

Returns:

getNumberOfErrorMessages

int getNumberOfErrorMessages()

getNumberOfMessages

int getNumberOfMessages(MessageType messageType)
Returns the number of messages with a specific messagetype.

Parameters:
messageType -
Returns:

getMessage

Message getMessage(Object object,
                   String propertyName)
Returns the first message associated with the given object and propertyName, if such a message is present else null.

Parameters:
object - object that is associated with the message.
propertyName - that is associated with the message.
Returns:
Returns the first message associated with the given object and propertyName, if such a message is present else null.

getMessages

List getMessages(Object object,
                 String propertyName)
Returns a list of Message instances associated with the given object and propertyName, if such a message is present.

Parameters:
object - object that is associated with the message.
propertyName - that is associated with the message.
Returns:
a list of Messageinstances associated with the given object and propertyName, if such a message is present.

getMessage

Message getMessage(Object object,
                   boolean objectLevelOnly)

getMessages

List getMessages(Object object,
                 boolean objectLevelOnly)

getMessages

List getMessages()

addMessages

void addMessages(Messages messages)
Adds messages.

Parameters:
messages -

getMessage

String getMessage()
Returns an overal messageMessage.

Returns:

convertMessageCodes

void convertMessageCodes(ResourceBundle resourceBundle)

clear

void clear()
Clears all messages in the container.



Copyright © 2007. All Rights Reserved.