A Validator implementation is a class that can perform validation
(correctness checks) on a jakarta.. Zero or more Validators
can be associated with each jakarta. in the view, and are called during
the Process Validations phase of the request processing lifecycle.
Individual Validators should examine the value and component that they are passed, and throw a
ValidatorException containing a jakarta., documenting any failures to
conform to the required rules.
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.
Validator implementations must have a zero-arguments public constructor. In addition, if the
Validator class wishes to have configuration property values saved and restored with the view, the
implementation must also implement jakarta..
If the class implementing Validator has a jakarta.
annotation, the action described in ResourceDependency must be taken when
jakarta. is called. If the class implementing
Validator has a jakarta. annotation, the action described
in ResourceDependencies must be taken when
jakarta. is called.
| Modifier and Type | Method and Description |
|---|---|
| public void | validate(FacesContext
FacesContext for the request we are processing context, UIComponent UIComponent we are checking for correctness component, T the value to validate value)
Perform the correctness checks implemented by this |
| validate | back to summary |
|---|---|
| public void validate(FacesContext context, UIComponent component, T value) throws ValidatorException
Perform the correctness checks implemented by this
For a validator to be fully compliant with Version 2 and later of the specification, it must not fail validation on
| |