| |
|
| java.lang.Object org.iscreen.ValidationFailure
ValidationFailure | public class ValidationFailure (Code) | | 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.
author: Shellman, Dan |
Method Summary | |
public Collection | getFields() Retrieves the fields (the OGNL expression used to 'get' the properties
from the JavaBean being validated) of the JavaBean being validated. | public 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. | public String | getLabel() Retrieves the label associated with this failure. | public String | getMessage() Retrieves the failure message (which has already been evaluated
and localized. | public String | getName() Retrieves the name of the validator reporting the failure message. | public void | setFields(Collection theFields) | public void | setIndex(Integer theIndex) | public void | setLabel(String theLabel) | public void | setMessage(String theMessage) | public void | setName(String theName) Sets the name for this failure message. |
ValidationFailure | public ValidationFailure()(Code) | | Default constructor.
|
getFields | public Collection getFields()(Code) | | Retrieves the fields (the OGNL expression used to 'get' the properties
from the JavaBean being validated) of the JavaBean being validated.
Returns the fields of the JavaBean being validated. |
getIndex | public Integer getIndex()(Code) | | 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. an object was being validated, and it had a property
that was an array/Collection that was 'forwarded' on to another
validation set and iterated over. The subsequent members of that
array/Collection would have an index of which was being validated
at a particular time. This is that index.). If no indexed property
was being validated, then this will return null. Note that a null
value is different than a zero value, as a zero value represents the
first element in an array/Collection, where a null value implies that
the JavaBean/Object wasn't involved in an array/Collection in the
first place.
Returns the index of the JavaBean/Object that was being validated. |
getLabel | public String getLabel()(Code) | | Retrieves the label associated with this failure.
Returns the label associated with this failure. |
getMessage | public String getMessage()(Code) | | Retrieves the failure message (which has already been evaluated
and localized.
Returns the failure message. |
getName | public String getName()(Code) | | Retrieves the name of the validator reporting the failure message.
Returns the name of the validator. |
setName | public void setName(String theName)(Code) | | Sets the name for this failure message. The name is used to identify the
failure message and relate it to a particular validator (the one that
reported the failure).
Parameters: theName - The name of the validator causing this failure. |
|
|
|