EditableValueHolder (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.faces.component Interface EditableValueHolder

所有父接口:
ValueHolder
所有已知实现子孙类:
HtmlInputHidden, HtmlInputSecret, HtmlInputText, HtmlInputTextarea, HtmlSelectBooleanCheckbox, HtmlSelectManyCheckbox, HtmlSelectManyListbox, HtmlSelectManyMenu, HtmlSelectOneListbox, HtmlSelectOneMenu, HtmlSelectOneRadio, UIInput, UISelectBoolean, UISelectMany, UISelectOne

public interface EditableValueHolder
extends ValueHolder

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


方法摘要
 void addValidator(Validator validator)
          Add a Validator instance to the set associated with this component.
 void addValueChangeListener(ValueChangeListener listener)
          Add a new ValueChangeListener to the set of listeners interested in being notified when ValueChangeEvents occur.
 Object getSubmittedValue()
          Return the submittedValue value of this component.
 MethodBinding getValidator()
          Deprecated. getValidators() should be used instead.
 Validator[] getValidators()
          Return the set of registered Validators for this component instance.
 MethodBinding getValueChangeListener()
          Deprecated. Use getValueChangeListeners() instead.
 ValueChangeListener[] getValueChangeListeners()
          Return the set of registered ValueChangeListeners for this component instance.
 boolean isImmediate()
          Return the "immediate" state for this component.
 boolean isLocalValueSet()
          Return the "local value set" state for this component.
 boolean isRequired()
          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 a Validator instance from the set associated with this component, if it was previously associated.
 void removeValueChangeListener(ValueChangeListener listener)
          Remove an existing ValueChangeListener (if any) from the set of listeners interested in being notified when ValueChangeEvents occur.
 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).
 void setValidator(MethodBinding validatorBinding)
          Deprecated. Use addValidator(javax.faces.validator.Validator) instead, obtaining the argument Validator by creating an instance of MethodExpressionValidator.
 void setValueChangeListener(MethodBinding valueChangeMethod)
          Deprecated. Use addValueChangeListener(javax.faces.event.ValueChangeListener) instead, obtaining the argument ValueChangeListener by creating an instance of MethodExpressionValueChangeListener.
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter, setValue
 

方法详细信息

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.


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.

参数:
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.


setLocalValueSet

void setLocalValueSet(boolean localValueSet)
Sets the "local value set" state for this component.


isValid

boolean isValid()

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


setValid

void setValid(boolean valid)

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

参数:
valid - The new valid flag

isRequired

boolean isRequired()

Return the "required field" state for this component.


setRequired

void setRequired(boolean required)

Set the "required field" state for this component.

参数:
required - The new "required field" state

isImmediate

boolean isImmediate()

Return the "immediate" state for this component.


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.

参数:
immediate - The new "immediate" state

getValidator

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

If setValidator(javax.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(javax.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).


setValidator

void setValidator(MethodBinding validatorBinding)
Deprecated. Use addValidator(javax.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.

参数:
validatorBinding - The new MethodBinding instance

getValueChangeListener

MethodBinding getValueChangeListener()
Deprecated. Use getValueChangeListeners() instead.

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


setValueChangeListener

void setValueChangeListener(MethodBinding valueChangeMethod)
Deprecated. Use addValueChangeListener(javax.faces.event.ValueChangeListener) instead, obtaining the argument ValueChangeListener by creating an instance of 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 ValueChangeEvent.

参数:
valueChangeMethod - The new method binding instance

addValidator

void addValidator(Validator validator)

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

参数:
validator - The Validator to add
抛出异常:
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.


removeValidator

void removeValidator(Validator validator)

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

参数:
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.

参数:
listener - The ValueChangeListener to be added
抛出异常:
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.


removeValueChangeListener

void removeValueChangeListener(ValueChangeListener listener)

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

参数:
listener - The ValueChangeListener to be removed
抛出异常:
NullPointerException - if listener is null

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.