Top Description Methods
jakarta.faces.component

public Interface EditableValueHolder

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

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 Validator<T>[]

Returns:

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

Return the set of registered Validators for this component instance.

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).

Inherited from jakarta.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 jakarta.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULLcontext-param.

Returns:Object

the submitted value.

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.

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 jakarta.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