Top Description Methods
javax.faces.component

public Interface EditableValueHolder

extends ValueHolder
Known Direct Implementers
javax.faces.component.UIInput
Imports
javax.faces.event.ValueChangeEvent, .ValueChangeListener, javax.faces.validator.Validator, javax.faces.el.MethodBinding, javax.faces.render.Renderer

EditableValueHolder is an extension of ValueHolder that describes additional features supported by editable components, including ValueChangeEvents and Validators.

Method Summary

Modifier and TypeMethod and Description
public void
addValidator(Validator<T>
The Validator to add
validator
)

Add a Validator instance to the set associated with this component.

public void
addValueChangeListener(ValueChangeListener
The ValueChangeListener to be added
listener
)

Add a new ValueChangeListener to the set of listeners interested in being notified when ValueChangeEvents occur.

public Object

Returns:

the submitted value.
getSubmittedValue
()

Return the submittedValue value of this component.

public MethodBinding

Returns:

the validator as a method binding.
getValidator
()

Deprecated getValidators should be used instead.

If setValidator was not previously called for this instance, this method must return null.

public Validator<T>[]

Returns:

the validators, or a zero-length array.
getValidators
()

Return the set of registered Validators for this component instance.

public MethodBinding

Returns:

the value change listener.
getValueChangeListener
()

Deprecated Use getValueChangeListeners instead.

If setValueChangeListener was not previously called for this instance, this method must return null.

public ValueChangeListener[]

Returns:

the value change listeners, or a zero-length array.
getValueChangeListeners
()

Return the set of registered ValueChangeListeners for this component instance.

public boolean

Returns:

true if is immediate, false otherwise.
isImmediate
()

Return the "immediate" state for this component.

public boolean

Returns:

true if the local value is set, false otherwise.
isLocalValueSet
()

Return the "local value set" state for this component.

public boolean

Returns:

true if required, false otherwise.
isRequired
()

Return the "required field" state for this component.

public boolean

Returns:

true if valid, false otherwise.
isValid
()

Return a flag indicating whether the local value of this component is valid (no conversion error has occurred).

public void
removeValidator(Validator<T>
The Validator to remove
validator
)

Remove a Validator instance from the set associated with this component, if it was previously associated.

public void
removeValueChangeListener(ValueChangeListener
The ValueChangeListener to be removed
listener
)

Remove an existing ValueChangeListener (if any) from the set of listeners interested in being notified when ValueChangeEvents occur.

public void
resetValue()

Convenience method to reset this component's value to the un-initialized state.

public void
setImmediate(boolean
The new "immediate" state
immediate
)

Set the "immediate" state for this component.

public void
setLocalValueSet(boolean
the "local value set" boolean.
localValueSet
)

Sets the "local value set" state for this component.

public void
setRequired(boolean
The new "required field" state
required
)

Set the "required field" state for this component.

public void
setSubmittedValue(Object
The new submitted value
submittedValue
)

Set the submittedValue value of this component.

public void
setValid(boolean
The new valid flag
valid
)

Set a flag indicating whether the local value of this component is valid (no conversion error has occurred).

public void
setValidator(MethodBinding
The new MethodBinding instance
validatorBinding
)

Deprecated Use addValidator instead, obtaining the argument Validator by creating an instance of javax.faces.validator.MethodExpressionValidator.

Wrap the argument validatorBinding in an implementation of javax.faces.validator.Validator and store it in the internal data structure that backs the getValidators method, taking care to over-write any instance that was stored by a previous call to setValidator.

public void
setValueChangeListener(MethodBinding
The new method binding instance
valueChangeMethod
)

Deprecated Use addValueChangeListener instead, obtaining the argument ValueChangeListener by creating an instance of javax.faces.event.MethodExpressionValueChangeListener.

Wrap the argument valueChangeMethod in an implementation of ValueChangeListener and store it in the internal data structure that backs the getValueChangeListeners method, taking care to over-write any instance that was stored by a previous call to setValueChangeListener.

Inherited from javax.faces.component.ValueHolder:
getConvertergetLocalValuegetValuesetConvertersetValue

Method Detail

addValidatorback to summary
public void addValidator(Validator<T> validator)

Add a Validator instance to the set associated with this component.

Parameters
validator:Validator<T>

The Validator to add

Exceptions
NullPointerException:
if validator is null
addValueChangeListenerback to summary
public void addValueChangeListener(ValueChangeListener listener)

Add a new ValueChangeListener to the set of listeners interested in being notified when ValueChangeEvents occur.

Parameters
listener:ValueChangeListener

The ValueChangeListener to be added

Exceptions
NullPointerException:
if listener is null
getSubmittedValueback to summary
public Object getSubmittedValue()

Return the submittedValue value of this component. This method should only be used by the encodeBegin() and/or encodeEnd() methods of this component, or its corresponding Renderer. The action taken based on whether the value is null, empty, or non-null is determined based on the value of the javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULLcontext-param.

Returns:Object

the submitted value.

getValidatorback to summary
public MethodBinding getValidator()

Deprecated

getValidators should be used instead.

If setValidator was not previously called for this instance, this method must return null. If it was called, this method must return the exact MethodBinding instance that was passed to setValidator.

This method will be called during the Process Validations or Apply Request Values phases (depending on the value of the immediate property).

Returns:MethodBinding

the validator as a method binding.

getValidatorsback to summary
public Validator<T>[] getValidators()

Return the set of registered Validators for this component instance. If there are no registered validators, a zero-length array is returned.

Returns:Validator<T>[]

the validators, or a zero-length array.

getValueChangeListenerback to summary
public MethodBinding getValueChangeListener()

Deprecated

Use getValueChangeListeners instead.

If setValueChangeListener was not previously called for this instance, this method must return null. If it was called, this method must return the exact MethodBinding instance that was passed to setValueChangeListener.

Returns:MethodBinding

the value change listener.

getValueChangeListenersback to summary
public ValueChangeListener[] getValueChangeListeners()

Return the set of registered ValueChangeListeners for this component instance. If there are no registered listeners, a zero-length array is returned.

Returns:ValueChangeListener[]

the value change listeners, or a zero-length array.

isImmediateback to summary
public boolean isImmediate()

Return the "immediate" state for this component.

Returns:boolean

true if is immediate, false otherwise.

isLocalValueSetback to summary
public boolean isLocalValueSet()

Return the "local value set" state for this component. Calls to setValue() automatically reset this property to true.

Returns:boolean

true if the local value is set, false otherwise.

isRequiredback to summary
public boolean isRequired()

Return the "required field" state for this component.

Returns:boolean

true if required, false otherwise.

isValidback to summary
public boolean isValid()

Return a flag indicating whether the local value of this component is valid (no conversion error has occurred).

Returns:boolean

true if valid, false otherwise.

removeValidatorback to summary
public void removeValidator(Validator<T> validator)

Remove a Validator instance from the set associated with this component, if it was previously associated. Otherwise, do nothing.

Parameters
validator:Validator<T>

The Validator to remove

removeValueChangeListenerback to summary
public void removeValueChangeListener(ValueChangeListener listener)

Remove an existing ValueChangeListener (if any) from the set of listeners interested in being notified when ValueChangeEvents occur.

Parameters
listener:ValueChangeListener

The ValueChangeListener to be removed

Exceptions
NullPointerException:
if listener is null
resetValueback to summary
public void resetValue()

Convenience method to reset this component's value to the un-initialized state.

Since
2.0
setImmediateback to summary
public void setImmediate(boolean immediate)

Set the "immediate" state for this component. When set to true, the component's value will be converted and validated immediately in the Apply Request Values phase, and ValueChangeEvents will be delivered in that phase as well. The default value for this property must be false.

Parameters
immediate:boolean

The new "immediate" state

setLocalValueSetback to summary
public void setLocalValueSet(boolean localValueSet)

Sets the "local value set" state for this component.

Parameters
localValueSet:boolean

the "local value set" boolean.

setRequiredback to summary
public void setRequired(boolean required)

Set the "required field" state for this component.

Parameters
required:boolean

The new "required field" state

setSubmittedValueback to summary
public void setSubmittedValue(Object submittedValue)

Set the submittedValue value of this component. This method should only be used by the decode() and validate() method of this component, or its corresponding Renderer. The action taken based on whether the value is null, empty, or non-null is determined based on the value of the javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULLcontext-param.

Parameters
submittedValue:Object

The new submitted value

setValidback to summary
public void setValid(boolean valid)

Set a flag indicating whether the local value of this component is valid (no conversion error has occurred).

Parameters
valid:boolean

The new valid flag

setValidatorback to summary
public void setValidator(MethodBinding validatorBinding)

Deprecated

Use addValidator instead, obtaining the argument Validator by creating an instance of javax.faces.validator.MethodExpressionValidator.

Wrap the argument validatorBinding in an implementation of javax.faces.validator.Validator and store it in the internal data structure that backs the getValidators method, taking care to over-write any instance that was stored by a previous call to setValidator.

The argument method will be called during the Process Validations or Apply Request Values phases (depending on the value of the immediate property).

Any method referenced by such an expression must be public, with a return type of void, and accept parameters of type javax.faces.context.FacesContext, UIComponent, and Object.

Parameters
validatorBinding:MethodBinding

The new MethodBinding instance

setValueChangeListenerback to summary
public void setValueChangeListener(MethodBinding valueChangeMethod)

Deprecated

Use addValueChangeListener instead, obtaining the argument ValueChangeListener by creating an instance of javax.faces.event.MethodExpressionValueChangeListener.

Wrap the argument valueChangeMethod in an implementation of ValueChangeListener and store it in the internal data structure that backs the getValueChangeListeners method, taking care to over-write any instance that was stored by a previous call to setValueChangeListener.

This argument method will be called during the Process Validations or Apply Request Values phases (depending on the value of the immediate property).

Any method referenced by such an expression must be public, with a return type of void, and accept a parameter of type javax.faces.event.ValueChangeEvent.

Parameters
valueChangeMethod:MethodBinding

The new method binding instance