Top Description Fields Constructors Methods
com.sun.faces.cdi

public Class CdiValidator

extends Object
implements Validator, StateHolder
Class Inheritance
All Implemented Interfaces
javax.faces.component.StateHolder, javax.faces.validator.Validator, java.util.EventListener
Imports
javax.faces.component.StateHolder, .UIComponent, javax.faces.context.FacesContext, javax.faces.validator.Validator, .ValidatorException

A delegate to the CDI managed validator.

Field Summary

Modifier and TypeField and Description
private transient Validator<T>
delegate

Stores a transient reference to the CDI managed converter.

private String
validatorId

Stores the validator-id.

Constructor Summary

AccessConstructor and Description
public
CdiValidator()

Constructor.

public
CdiValidator(String
the validator id.
validatorId
,
Validator<T>
the delegate.
delegate
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
private Validator<T>

Returns:

the delegate.
getDelegate
(FacesContext
the Faces context.
facesContext
)

Get the delegate.

public boolean

Returns:

false
isTransient
()

Implements javax.faces.component.StateHolder.isTransient.

Is the validator transient.
public void
restoreState(FacesContext
the Faces context.
facesContext
,
Object
the state.
state
)

Implements javax.faces.component.StateHolder.restoreState.

Restore the state.
public Object

Returns:

the saved object.
saveState
(FacesContext
the Faces context.
facesContext
)

Implements javax.faces.component.StateHolder.saveState.

Save the state.
public void
setTransient(boolean
the transient value.
transientValue
)

Implements javax.faces.component.StateHolder.setTransient.

Set the validator to transient.
public void
validate(FacesContext
the Faces context.
facesContext
,
UIComponent
the UI component.
component
,
Object
the value.
value
)

Implements javax.faces.validator.Validator.validate.

Validate.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private transient Validator<T> delegate

Stores a transient reference to the CDI managed converter.

validatorIdback to summary
private String validatorId

Stores the validator-id.

Constructor Detail

CdiValidatorback to summary
public CdiValidator()

Constructor.

CdiValidatorback to summary
public CdiValidator(String validatorId, Validator<T> delegate)

Constructor.

Parameters
validatorId:String

the validator id.

delegate:Validator<T>

the delegate.

Method Detail

getDelegateback to summary
private Validator<T> getDelegate(FacesContext facesContext)

Get the delegate.

Parameters
facesContext:FacesContext

the Faces context.

Returns:Validator<T>

the delegate.

isTransientback to summary
public boolean isTransient()

Implements javax.faces.component.StateHolder.isTransient.

Is the validator transient.

Returns:boolean

false

Annotations
@Override
restoreStateback to summary
public void restoreState(FacesContext facesContext, Object state)

Implements javax.faces.component.StateHolder.restoreState.

Restore the state.

Parameters
facesContext:FacesContext

the Faces context.

state:Object

the state.

Annotations
@Override
saveStateback to summary
public Object saveState(FacesContext facesContext)

Implements javax.faces.component.StateHolder.saveState.

Save the state.

Parameters
facesContext:FacesContext

the Faces context.

Returns:Object

the saved object.

Annotations
@Override
setTransientback to summary
public void setTransient(boolean transientValue)

Implements javax.faces.component.StateHolder.setTransient.

Set the validator to transient.

We ignore the call as our proxy is always non-transient.

Parameters
transientValue:boolean

the transient value.

Annotations
@Override
validateback to summary
public void validate(FacesContext facesContext, UIComponent component, Object value) throws ValidatorException

Implements javax.faces.validator.Validator.validate.

Validate.

Parameters
facesContext:FacesContext

the Faces context.

component:UIComponent

the UI component.

value:Object

the value.

Annotations
@Override
Exceptions
ValidatorException:
when a validation error occurs.