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

public interface EditableValueHolder extends ValueHolder

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

  • Method Details

    • getSubmittedValue

      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:
      the submitted value.
    • resetValue

      void resetValue()

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

      Since:
      2.0
    • setSubmittedValue

      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 - The new submitted value
    • isLocalValueSet

      boolean isLocalValueSet()
      Return the "local value set" state for this component. Calls to setValue() automatically reset this property to true.
      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 ValueChangeEvents will be delivered in that phase as well. The default value for this property must be false.

      Parameters:
      immediate - The new "immediate" state
    • addValidator

      void addValidator(Validator validator)

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

      Parameters:
      validator - The Validator to add
      Throws:
      NullPointerException - if validator is null
    • getValidators

      Validator[] getValidators()

      Return the set of registered Validators 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

      void removeValidator(Validator validator)

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

      Parameters:
      validator - The Validator to remove
    • addValueChangeListener

      void addValueChangeListener(ValueChangeListener listener)

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

      Parameters:
      listener - The ValueChangeListener to be added
      Throws:
      NullPointerException - if listener is null
    • getValueChangeListeners

      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:
      the value change listeners, or a zero-length array.
    • removeValueChangeListener

      void removeValueChangeListener(ValueChangeListener listener)

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

      Parameters:
      listener - The ValueChangeListener to be removed
      Throws:
      NullPointerException - if listener is null
    • getValidator

      @Deprecated MethodBinding getValidator()
      Deprecated.
      getValidators() should be used instead.

      If setValidator(jakarta.faces.el.MethodBinding) 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(jakarta.faces.el.MethodBinding).

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

      Returns:
      the validator as a method binding.
    • setValidator

      @Deprecated void setValidator(MethodBinding validatorBinding)
      Deprecated.
      Use addValidator(jakarta.faces.validator.Validator) instead, obtaining the argument Validator by creating an instance of MethodExpressionValidator.

      Wrap the argument validatorBinding in an implementation of 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 FacesContext, UIComponent, and Object.

      Parameters:
      validatorBinding - The new MethodBinding instance
    • getValueChangeListener

      @Deprecated MethodBinding getValueChangeListener()
      Deprecated.

      If setValueChangeListener(jakarta.faces.el.MethodBinding) 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(jakarta.faces.el.MethodBinding).

      Returns:
      the value change listener.
    • setValueChangeListener

      @Deprecated void setValueChangeListener(MethodBinding valueChangeMethod)
      Deprecated.

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

      Parameters:
      valueChangeMethod - The new method binding instance