Package jakarta.faces.validator
Class RequiredValidator
- java.lang.Object
- 
- jakarta.faces.validator.RequiredValidator
 
- 
- All Implemented Interfaces:
- Validator,- EventListener
 
 public class RequiredValidator extends 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 SummaryFields Modifier and Type Field Description static StringVALIDATOR_IDThe standard converter id for this converter.
 - 
Constructor SummaryConstructors Constructor Description RequiredValidator()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvalidate(FacesContext context, UIComponent component, Object value)Verify that the converted object value is not null.
 
- 
- 
- 
Field Detail- 
VALIDATOR_IDpublic static final String VALIDATOR_ID The standard converter id for this converter. - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
validatepublic void validate(FacesContext context, UIComponent component, Object value) Verify that the converted object value is not null. - Specified by:
- validatein interface- Validator
- Parameters:
- context- FacesContext for the request we are processing
- component- UIComponent we are checking for correctness
- value- the value to validate
- Throws:
- ValidatorException- if validation fails
 
 
- 
 
-