Interface EditableValueHolder
- All Superinterfaces:
ValueHolder
- All Known Implementing Classes:
HtmlInputFile
,HtmlInputHidden
,HtmlInputSecret
,HtmlInputText
,HtmlInputTextarea
,HtmlSelectBooleanCheckbox
,HtmlSelectManyCheckbox
,HtmlSelectManyListbox
,HtmlSelectManyMenu
,HtmlSelectOneListbox
,HtmlSelectOneMenu
,HtmlSelectOneRadio
,UIInput
,UISelectBoolean
,UISelectMany
,UISelectOne
,UIViewParameter
EditableValueHolder is an extension of
ValueHolder that describes additional features supported by editable components, including ValueChangeEvent
s
and Validator
s.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addValidator
(Validator validator) Add aValidator
instance to the set associated with this component.void
addValueChangeListener
(ValueChangeListener listener) Add a newValueChangeListener
to the set of listeners interested in being notified whenValueChangeEvent
s occur.Return the submittedValue value of this component.Return the set of registeredValidator
s for this component instance.Return the set of registeredValueChangeListener
s for this component instance.boolean
Return the "immediate" state for this component.boolean
Return the "local value set" state for this component.boolean
Return the "required field" state for this component.boolean
isValid()
Return a flag indicating whether the local value of this component is valid (no conversion error has occurred).void
removeValidator
(Validator validator) Remove aValidator
instance from the set associated with this component, if it was previously associated.void
removeValueChangeListener
(ValueChangeListener listener) Remove an existingValueChangeListener
(if any) from the set of listeners interested in being notified whenValueChangeEvent
s occur.void
Convenience method to reset this component's value to the un-initialized state.void
setImmediate
(boolean immediate) Set the "immediate" state for this component.void
setLocalValueSet
(boolean localValueSet) Sets the "local value set" state for this component.void
setRequired
(boolean required) Set the "required field" state for this component.void
setSubmittedValue
(Object submittedValue) Set the submittedValue value of this component.void
setValid
(boolean valid) Set a flag indicating whether the local value of this component is valid (no conversion error has occurred).Methods inherited from interface jakarta.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter, setValue
-
Method Details
-
getSubmittedValue
Object getSubmittedValue()Return the submittedValue value of this component. This method should only be used by the
encodeBegin()
and/orencodeEnd()
methods of this component, or its correspondingRenderer
. The action taken based on whether the value isnull
, empty, or non-null
is determined based on the value of thejakarta.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
context-param.- Returns:
- the submitted value.
-
resetValue
void resetValue()Convenience method to reset this component's value to the un-initialized state.
- Since:
- 2.0
-
setSubmittedValue
Set the submittedValue value of this component. This method should only be used by the
decode()
andvalidate()
method of this component, or its correspondingRenderer
. The action taken based on whether the value isnull
, empty, or non-null
is determined based on the value of thejakarta.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
context-param.- Parameters:
submittedValue
- The new submitted value
-
isLocalValueSet
boolean isLocalValueSet()Return the "local value set" state for this component. Calls tosetValue()
automatically reset this property totrue
.- Returns:
true
if the local value is set,false
otherwise.
-
setLocalValueSet
void setLocalValueSet(boolean localValueSet) Sets the "local value set" state for this component.- Parameters:
localValueSet
- the "local value set" boolean.
-
isValid
boolean isValid()Return a flag indicating whether the local value of this component is valid (no conversion error has occurred).
- Returns:
true
if valid,false
otherwise.
-
setValid
void setValid(boolean valid) Set a flag indicating whether the local value of this component is valid (no conversion error has occurred).
- Parameters:
valid
- The new valid flag
-
isRequired
boolean isRequired()Return the "required field" state for this component.
- Returns:
true
if required,false
otherwise.
-
setRequired
void setRequired(boolean required) Set the "required field" state for this component.
- Parameters:
required
- The new "required field" state
-
isImmediate
boolean isImmediate()Return the "immediate" state for this component.
- Returns:
true
if is immediate,false
otherwise.
-
setImmediate
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
ValueChangeEvent
s will be delivered in that phase as well. The default value for this property must befalse
.- Parameters:
immediate
- The new "immediate" state
-
addValidator
Add a
Validator
instance to the set associated with this component.- Parameters:
validator
- TheValidator
to add- Throws:
NullPointerException
- ifvalidator
is null
-
getValidators
Validator[] getValidators()Return the set of registered
Validator
s for this component instance. If there are no registered validators, a zero-length array is returned.- Returns:
- the validators, or a zero-length array.
-
removeValidator
Remove a
Validator
instance from the set associated with this component, if it was previously associated. Otherwise, do nothing.- Parameters:
validator
- TheValidator
to remove
-
addValueChangeListener
Add a new
ValueChangeListener
to the set of listeners interested in being notified whenValueChangeEvent
s occur.- Parameters:
listener
- TheValueChangeListener
to be added- Throws:
NullPointerException
- iflistener
isnull
-
getValueChangeListeners
ValueChangeListener[] getValueChangeListeners()Return the set of registered
ValueChangeListener
s for this component instance. If there are no registered listeners, a zero-length array is returned.- Returns:
- the value change listeners, or a zero-length array.
-
removeValueChangeListener
Remove an existing
ValueChangeListener
(if any) from the set of listeners interested in being notified whenValueChangeEvent
s occur.- Parameters:
listener
- TheValueChangeListener
to be removed- Throws:
NullPointerException
- iflistener
isnull
-