Package javax.faces.validator
Class RequiredValidator
- java.lang.Object
-
- javax.faces.validator.RequiredValidator
-
- All Implemented Interfaces:
java.util.EventListener
,Validator
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.
- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
VALIDATOR_ID
The standard converter id for this converter.-
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
-
-
Constructor Summary
Constructors Constructor Description RequiredValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
validate(FacesContext context, UIComponent component, java.lang.Object value)
Verify that the converted object value is not null.
-
-
-
Field Detail
-
VALIDATOR_ID
public static final java.lang.String VALIDATOR_ID
The standard converter id for this converter.
- See Also:
- Constant Field Values
-
-
Method Detail
-
validate
public void validate(FacesContext context, UIComponent component, java.lang.Object value)
Verify that the converted object value is not null.
- Specified by:
validate
in interfaceValidator
- Parameters:
context
- FacesContext for the request we are processingcomponent
- UIComponent we are checking for correctnessvalue
- the value to validate- Throws:
ValidatorException
- if validation fails
-
-