public class RequiredValidator extends java.lang.Object implements Validator
A Validator that checks for an empty value in the same way that UIInput checks for a value. In fact, this validator is equivalent to setting the required attribute on the input component to true.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VALIDATOR_ID
The standard converter id for this converter.
|
Constructor and Description |
---|
RequiredValidator() |
Modifier and Type | Method and Description |
---|---|
void |
validate(FacesContext context,
UIComponent component,
java.lang.Object value)
Verify that the converted object value is not null.
|
public static final java.lang.String VALIDATOR_ID
The standard converter id for this converter.
public void validate(FacesContext context, UIComponent component, java.lang.Object value)
Verify that the converted object value is not null.
validate
in interface Validator
context
- FacesContext for the request we are processingcomponent
- UIComponent we are checking for correctnessvalue
- the value to validateValidatorException
- if validation fails