Top Description Fields Constructors Methods
javax.faces.component

pack-priv Class MethodBindingValidator

extends MethodBindingAdapterBase
implements Validator, StateHolder
Class Inheritance
All Implemented Interfaces
javax.faces.component.StateHolder, javax.faces.validator.Validator, java.util.EventListener
Imports
javax.faces.validator.Validator, .ValidatorException, javax.faces.el.MethodBinding, .EvaluationException, javax.faces.context.FacesContext

MethodBindingValidator is an ValidatorListener that wraps a MethodBinding. When it receives a ActionEvent, it executes a method on an object identified by the MethodBinding.

Field Summary

Modifier and TypeField and Description
private MethodBinding
methodBinding

Deprecated as a consequence of MethodBinding being deprecated.
private boolean

Constructor Summary

AccessConstructor and Description
public
public
MethodBindingValidator(MethodBinding methodBinding)

Deprecated as a consequence of MethodBinding being deprecated.

Construct a Validator that contains a MethodBinding.

Method Summary

Modifier and TypeMethod and Description
public MethodBinding
getWrapped()

Deprecated as a consequence of MethodBinding being deprecated.
public boolean
isTransient()

Implements javax.faces.component.StateHolder.isTransient.

If true, the Object implementing this interface must not participate in state saving or restoring.

private static Class<T>
loadClass(String name, Object fallbackClass)

public void
restoreState(FacesContext
the Faces context.
context
,
Object
the state.
state
)

Implements javax.faces.component.StateHolder.restoreState.

Perform any processing required to restore the state from the entries in the state Object.

public Object
saveState(FacesContext
the Faces context.
context
)

Implements javax.faces.component.StateHolder.saveState.

Gets the state of the instance as a Serializable Object.

public void
setTransient(boolean
boolean pass true if this Object will not participate in state saving or restoring, otherwise pass false.
newTransientValue
)

Implements javax.faces.component.StateHolder.setTransient.

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

public void
validate(FacesContext
FacesContext for the request we are processing
context
,
UIComponent
UIComponent we are checking for correctness
component
,
Object
the value to validate
value
)

Implements javax.faces.validator.Validator.validate.

Perform the correctness checks implemented by this Validator against the specified UIComponent.

Inherited from javax.faces.component.MethodBindingAdapterBase:
getExpectedCause

Field Detail

methodBindingback to summary
private MethodBinding methodBinding

Deprecated

as a consequence of MethodBinding being deprecated. See corresponding docs for further information.

tranzientback to summary
private boolean tranzient

Constructor Detail

MethodBindingValidatorback to summary
public MethodBindingValidator()
MethodBindingValidatorback to summary
public MethodBindingValidator(MethodBinding methodBinding)

Deprecated

as a consequence of MethodBinding being deprecated. See corresponding docs for further information.

Construct a Validator that contains a MethodBinding.

Method Detail

getWrappedback to summary
public MethodBinding getWrapped()

Deprecated

as a consequence of MethodBinding being deprecated. See corresponding docs for further information.

isTransientback to summary
public boolean isTransient()

Implements javax.faces.component.StateHolder.isTransient.

Doc from javax.faces.component.StateHolder.isTransient.

If true, the Object implementing this interface must not participate in state saving or restoring.

Returns:boolean

true if transient, false otherwise.

Annotations
@Override
loadClassback to summary
private static Class<T> loadClass(String name, Object fallbackClass) throws ClassNotFoundException
restoreStateback to summary
public void restoreState(FacesContext context, Object state)

Implements javax.faces.component.StateHolder.restoreState.

Doc from javax.faces.component.StateHolder.restoreState.

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the restoreState method on all those instances as well.

If the state argument is null, take no action and return.

Parameters
context:FacesContext

the Faces context.

state:Object

the state.

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

Implements javax.faces.component.StateHolder.saveState.

Doc from javax.faces.component.StateHolder.saveState.

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the saveState method on all those instances as well. This method must not save the state of children and facets. That is done via the javax.faces.application.StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:


Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Parameters
context:FacesContext

the Faces context.

Returns:Object

the saved state.

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

Implements javax.faces.component.StateHolder.setTransient.

Doc from javax.faces.component.StateHolder.setTransient.

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Parameters
newTransientValue:boolean

boolean pass true if this Object will not participate in state saving or restoring, otherwise pass false.

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

Implements javax.faces.validator.Validator.validate.

Doc from javax.faces.validator.Validator.validate.

Perform the correctness checks implemented by this Validator against the specified UIComponent. If any violations are found, a ValidatorException will be thrown containing the javax.faces.application.FacesMessage describing the failure.

For a validator to be fully compliant with Version 2 and later of the specification, it must not fail validation on null or empty values unless it is specifically intended to address null or empty values. An application-wide <context-param> is provided to allow validators designed for JSF 1.2 to work with JSF 2 and later. The javax.faces.VALIDATE_EMPTY_FIELDS <context-param> must be set to false to enable this backwards compatibility behavior.

Parameters
context:FacesContext

FacesContext for the request we are processing

component:UIComponent

UIComponent we are checking for correctness

value:Object

the value to validate

Annotations
@Override
Exceptions
ValidatorException:
if validation fails