|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A Validator implementation is a class that can perform
validation (correctness checks) on a UIComponent. Zero or more
Validators can be associated with each UIComponent
in the component tree, and are called during the Process
Validations phase of the request processing lifecycle.
Individual Validators should examine the component that
they are passed, and add Message instances to the
FacesContext for the current request, documenting
any failures to conform to the required rules. In general, such
messages should be associated with the UIComponent on which
the validation failure occurred. In addition, the valid
property of the corresponding UIComponent should be set to
false on validation failures.
For maximum generality, Validator instances may be
configurable based on properties of the Validator implementation
class. For example, a range check Validator might support
configuration of the minimum and maximum values to be used. In
addition, because Validators are part of the saved and restored
state of a component tree, classes that implement this interface must also
be serializable.
| Method Summary | |
void |
validate(FacesContext context,
UIComponent component)
Perform the correctness checks implemented by this Validator against the specified UIComponent. |
| Method Detail |
public void validate(FacesContext context,
UIComponent component)
Perform the correctness checks implemented by this
Validator against the specified UIComponent.
If any violations are found:
Messages to the specified
FacesContext, specifying this UIComponent as
associated with the message, describing the nature of the
violation(s) encountered.valid property on the specified
UIComponent to false.
context - FacesContext for the request we are processingcomponent - UIComponent we are checking for correctness
java.lang.NullPointerException - if context
or component is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||