|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ValidationFailure
A validation failure represents a single failure reported by a Validator
(Validators can report multiple failures, each represented by a separate
instance of this class). Each failure has a message (usually designed
to be accessible to the end user), a label (usually used to associate
the failure with an UI component, though a label is not required), and
the Collection of fields (these are really the OGNL expressions used to 'get'
properties from the JavaBean being validated) from the JavaBean that was
originally validated (normally, there's just one field).
Interface code (such as a web framework) can use instances of this
class to display the validation failures. There should be sufficient
information associated with each failure to apply the message to
the correct location within the interface.
Field Summary | |
---|---|
static int |
CRITICAL
Severity level of critical. |
static int |
FAILURE
Severity level of failure. |
static int |
WARNING
Severity level of warning. |
Method Summary | |
---|---|
java.lang.Object |
getFailureBean()
Obtains a reference to the bean that failed validation. |
java.util.Collection |
getFields()
Retrieves the fields (the OGNL/MVEL expression used to 'get' the properties from the JavaBean being validated) of the JavaBean being validated. |
java.lang.Integer |
getIndex()
Retrieves the index of the JavaBean/Object being validated that was an element within an array/Collection of a 'parent' JavaBean being validated (i.e. |
java.lang.String |
getLabel()
Retrieves the label associated with this failure. |
java.lang.String |
getMessage()
Retrieves the failure message (which has already been evaluated and localized). |
java.lang.String |
getMessage(java.lang.String messageName)
Retrieves the failure message based upon the message name. |
java.lang.String |
getName()
Retrieves the name of the validator reporting the failure message. |
int |
getSeverity()
Retrieves the severity of the failure (i.e. |
ValidationTrace |
getTrace()
Retrieves the trace of the failure. |
Field Detail |
---|
static final int WARNING
static final int FAILURE
static final int CRITICAL
Method Detail |
---|
java.lang.String getLabel()
java.lang.String getName()
java.lang.String getMessage()
java.lang.String getMessage(java.lang.String messageName)
messageName
- The 'name' of the message (defined in
the configuration.
int getSeverity()
java.util.Collection getFields()
java.lang.Integer getIndex()
ValidationTrace getTrace()
java.lang.Object getFailureBean()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |