org.iscreen
Interface FailureMessage

All Known Implementing Classes:
MvelMessage, MvelResourceMessage, OgnlMessage, OgnlResourceMessage

public interface FailureMessage

A failure message is a holding interface for objects that represent failure messages. These are passed to Validators to use to report particular failures. For example, a Validator may report two different types of failures, so it'll be configured with two different instances of this interface, which it will use to report failures, depending upon the type.

Author:
Shellman, Dan

Method Summary
 java.util.Map getExtraMessages()
          Retrieves additional messages that are associated with the failure.
 java.lang.String getMessage(java.lang.Object obj, java.util.Locale locale)
          Get the actual failure message.
 int getSeverity()
          Retrieves the failure's severity level.
 

Method Detail

getMessage

java.lang.String getMessage(java.lang.Object obj,
                            java.util.Locale locale)
Get the actual failure message. Validators shouldn't call this method, as it's used by the context to construct the actual failure object that is eventually returned. This method takes an additional locale for internationalization support.

Parameters:
obj - An object used in generating the message
locale - The locale use for localizing the message.

getSeverity

int getSeverity()
Retrieves the failure's severity level. The higher the severity level (numerically), the "worse" the failure. See the constants defined in this interface for "standard" severity levels.

Returns:
Returns the failure's severity level.

getExtraMessages

java.util.Map getExtraMessages()
Retrieves additional messages that are associated with the failure. These additional messages are based upon a name and can be found in the config as sub-elements to the 'failure' element.

Returns:
Returns a map of message names to messages. The messages are, themselves, FailureMessage objects.