Package com.sun.faces.cdi
Class CdiValidator
- java.lang.Object
-
- com.sun.faces.cdi.CdiValidator
-
- All Implemented Interfaces:
StateHolder
,Validator
,EventListener
public class CdiValidator extends Object implements Validator, StateHolder
A delegate to the CDI managed validator.
-
-
Constructor Summary
Constructors Constructor Description CdiValidator()
Constructor.CdiValidator(String validatorId, Validator delegate)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isTransient()
Is the validator transient.void
restoreState(FacesContext facesContext, Object state)
Restore the state.Object
saveState(FacesContext facesContext)
Save the state.void
setTransient(boolean transientValue)
Set the validator to transient.void
validate(FacesContext facesContext, UIComponent component, Object value)
Validate.
-
-
-
Method Detail
-
saveState
public Object saveState(FacesContext facesContext)
Save the state.- Specified by:
saveState
in interfaceStateHolder
- Parameters:
facesContext
- the Faces context.- Returns:
- the saved object.
-
restoreState
public void restoreState(FacesContext facesContext, Object state)
Restore the state.- Specified by:
restoreState
in interfaceStateHolder
- Parameters:
facesContext
- the Faces context.state
- the state.
-
isTransient
public boolean isTransient()
Is the validator transient.- Specified by:
isTransient
in interfaceStateHolder
- Returns:
- false
-
setTransient
public void setTransient(boolean transientValue)
Set the validator to transient.We ignore the call as our proxy is always non-transient.
- Specified by:
setTransient
in interfaceStateHolder
- Parameters:
transientValue
- the transient value.
-
validate
public void validate(FacesContext facesContext, UIComponent component, Object value) throws ValidatorException
Validate.- Specified by:
validate
in interfaceValidator
- Parameters:
facesContext
- the Faces context.component
- the UI component.value
- the value.- Throws:
ValidatorException
- when a validation error occurs.
-
-