EditableValueHolder (Java EE 5)

Java EE API


javax.faces.component Interface EditableValueHolder

All Superinterfaces:
ValueHolder
All Known Implementing Classes:
HtmlInputHidden, HtmlInputSecret, HtmlInputText, HtmlInputTextarea, HtmlSelectBooleanCheckbox, HtmlSelectManyCheckbox, HtmlSelectManyListbox, HtmlSelectManyMenu, HtmlSelectOneListbox, HtmlSelectOneMenu, HtmlSelectOneRadio, UIInput, UISelectBoolean, UISelectMany, UISelectOne

public interface EditableValueHolder
extends ValueHolder

Implements: ValueHolder
Implemented by: UIInput

EditableValueHolder 是描述可编辑组件(包括 ValueChangeEventValidator)支持的额外功能的 ValueHolder 的扩展。

英文文档:

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


Method Summary
 void
 void
 Object
 MethodBinding
 Validator[]
 MethodBinding
 ValueChangeListener[]
 boolean
 boolean
 boolean
 boolean
 void
 void
 void
 void
 void
 void
 void
 void
 void
 
Methods inherited from interface javax.faces.component.ValueHolder
 

Method Detail

public Object getSubmittedValue()

返回此组件的 submittedValue 值。此方法仅供此组件或其相应 RendererencodeBegin() 和/或 encodeEnd() 方法使用。

英文文档:

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.


public void setSubmittedValue(Object submittedValue)

设置此组件的 submittedValue 值。此方法仅供此组件或其相应 Rendererdecode()validate() 方法使用。

submittedValue 新提交的值
英文文档:

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.

Parameters:
submittedValue - The new submitted value

public boolean isLocalValueSet()
返回此组件的 "local value set" 状态。调用 setValue() 自动将此属性重置为 true
英文文档:

isLocalValueSet

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


public void setLocalValueSet(boolean localValueSet)
设置此组件的 "local value set" 状态。
英文文档:

setLocalValueSet

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


public boolean isValid()

返回一个标志,指示此组件的本地值是否有效(没有发生转换错误)。

英文文档:

isValid

boolean isValid()

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


public void setValid(boolean valid)

设置一个标志,指示此组件的本地值是否有效(没有发生转换错误)。

valid 新的有效标志
英文文档:

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

public boolean isRequired()

返回此组件的 "required field" 状态。

英文文档:

isRequired

boolean isRequired()

Return the "required field" state for this component.


public void setRequired(boolean required)

设置此组件的 "required field" 状态。

required 新的 "required field" 状态
英文文档:

setRequired

void setRequired(boolean required)

Set the "required field" state for this component.

Parameters:
required - The new "required field" state

public boolean isImmediate()

返回此组件的 "immediate" 状态。

英文文档:

isImmediate

boolean isImmediate()

Return the "immediate" state for this component.


public void setImmediate(boolean immediate)

设置此组件的 "immediate" 状态。设置为 true 时,将在应用请求值 阶段立即转换和验证组件的值,并且 ValueChangeEvent 也将在该阶段提供。此属性的默认值必须为 false

immediate 新的 "immediate" 状态
英文文档:

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

public MethodBinding getValidator()

如果以前没有为此实例调用过 #setValidator,则此方法必须返回 null。如果调用过 #setValidator,则此方法必须返回原先传递给 #setValidator 的那个 MethodBinding 实例。

此方法将在处理验证应用请求值 阶段(取决于 immediate 属性的值)调用。

deprecated 应改用 #getValidators
英文文档:

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


public void setValidator(MethodBinding validatorBinding)

javax.faces.validator.Validator 的实现中包装参数 validatorBinding,并将其存储在支持 #getValidators 方法的内部数据结构中,小心地重写通过以前调用 setValidator 存储的任何实例。

此参数方法将在处理验证应用请求值 阶段(取决于 immediate 属性的值)调用。

此表达式所引用的任何方法都必须是公共的,返回类型为 void,并接受类型为 javax.faces.context.FacesContextUIComponentObject 的参数。

validatorBinding 新的 MethodBinding 实例
deprecated 请改用 #addValidator,通过创建 javax.faces.validator.MethodExpressionValidator 的实例获取参数 Validator
英文文档:

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.

Parameters:
validatorBinding - The new MethodBinding instance

public MethodBinding getValueChangeListener()

如果以前没有为此实例调用过 #setValueChangeListener,则此方法必须返回 null。如果调用过 #setValueChangeListener,则此方法必须返回原先传递给 #setValueChangeListener 的那个 MethodBinding 实例。

deprecated 请改用 #getValueChangeListeners
英文文档:

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


public void setValueChangeListener(MethodBinding valueChangeMethod)

ValueChangeListener 的实现中包装参数 valueChangeMethod,并将其存储在支持 #getValueChangeListeners 方法的内部数据结构中,小心地重写通过以前调用 setValueChangeListener 存储的任何实例。

此参数方法将在处理验证应用请求值 阶段(取决于 immediate 属性的值)调用。

此表达式所引用的任何方法都必须是公共的,返回类型为 void,并接受类型为 javax.faces.event.ValueChangeEvent 的参数。

valueChangeMethod 新的方法绑定实例
deprecated 请改用 #addValueChangeListener,通过创建 javax.faces.event.MethodExpressionValueChangeListener 的实例获取参数 ValueChangeListener
英文文档:

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.

Parameters:
valueChangeMethod - The new method binding instance

public void addValidator(Validator validator)

Validator 实例添加到与此组件关联的集合。

validator 要添加的 Validator
ThrowsNullPointerException: 如果 validator 为 null
英文文档:

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

public Validator[] getValidators()

返回此组件实例已注册的 Validator 的集合。如果不存在任何已注册验证器,则返回一个长度为 0 的数组。

英文文档:

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.


public void removeValidator(Validator validator)

从与此组件关联的集合中移除 Validator 实例(如果以前将它们关联过)。否则,不执行任何操作。

validator 要移除的 Validator
英文文档:

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

public void addValueChangeListener(ValueChangeListener listener)

向希望在发生 ValueChangeEvent 时获得通知的侦听器集合中添加一个新的 ValueChangeListener

listener 要添加的 ValueChangeListener
ThrowsNullPointerException: 如果 listenernull
英文文档:

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

public ValueChangeListener[] getValueChangeListeners()

返回此组件实例已注册的 ValueChangeListener 的集合。如果不存在任何已注册侦听器,则返回一个长度为 0 的数组。

英文文档:

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.


public void removeValueChangeListener(ValueChangeListener listener)

从希望在发生 ValueChangeEvent 时获得通知的侦听器集合中移除一个现有的 ValueChangeListener(如果有)。

listener 要移除的 ValueChangeListener
ThrowsNullPointerException: 如果 listenernull
英文文档:

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


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!