|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
EditableValueHolder 是描述可编辑组件(包括 ValueChangeEvent
和 Validator
)支持的额外功能的 ValueHolder 的扩展。
EditableValueHolder is an extension of ValueHolder
that describes additional features supported by editable components,
including ValueChangeEvent
s and Validator
s.
Method Summary | |
---|---|
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 ValueChangeEvent s 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 Validator s for this
component instance. |
MethodBinding |
getValueChangeListener()
Deprecated. Use getValueChangeListeners() instead. |
ValueChangeListener[] |
getValueChangeListeners()
Return the set of registered ValueChangeListener s 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
ValueChangeEvent s 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 |
Method Detail |
---|
public Object
getSubmittedValue()
返回此组件的 submittedValue 值。此方法仅供此组件或其相应 Renderer
的 encodeBegin()
和/或 encodeEnd()
方法使用。
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
.
public void
setSubmittedValue(Object submittedValue)
设置此组件的 submittedValue 值。此方法仅供此组件或其相应 Renderer
的 decode()
和 validate()
方法使用。
submittedValue | 新提交的值 |
setSubmittedValue
void setSubmittedValue(Object submittedValue)
Set the submittedValue value of this component. This method should only be used by the
decode()
andvalidate()
method of this component, or its correspondingRenderer
.- 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 totrue
.
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
ValueChangeEvent
s will be delivered in that phase as well. The default value for this property must befalse
.- 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 returnnull
. If it was called, this method must return the exactMethodBinding
instance that was passed tosetValidator(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.FacesContext
、UIComponent
和 Object
的参数。
validatorBinding |
新的 MethodBinding 实例 |
deprecated |
请改用 #addValidator ,通过创建 javax.faces.validator.MethodExpressionValidator 的实例获取参数 Validator 。 |
setValidator
void setValidator(MethodBinding validatorBinding)
- Deprecated. Use
addValidator(javax.faces.validator.Validator)
instead, obtaining the argumentValidator
by creating an instance ofMethodExpressionValidator
. Wrap the argument
validatorBinding
in an implementation ofValidator
and store it in the internal data structure that backs thegetValidators()
method, taking care to over-write any instance that was stored by a previous call tosetValidator
.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 typeFacesContext
,UIComponent
, andObject
.- Parameters:
validatorBinding
- The newMethodBinding
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 returnnull
. If it was called, this method must return the exactMethodBinding
instance that was passed tosetValueChangeListener(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 argumentValueChangeListener
by creating an instance ofMethodExpressionValueChangeListener
. Wrap the argument
valueChangeMethod
in an implementation ofValueChangeListener
and store it in the internal data structure that backs thegetValueChangeListeners()
method, taking care to over-write any instance that was stored by a previous call tosetValueChangeListener
.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 typeValueChangeEvent
.- Parameters:
valueChangeMethod
- The new method binding instance
public void
addValidator(Validator validator)
将 Validator
实例添加到与此组件关联的集合。
validator |
要添加的 Validator |
Throws | NullPointerException:
如果 validator 为 null |
addValidator
void addValidator(Validator validator)
Add a
Validator
instance to the set associated with this component.- Parameters:
validator
- TheValidator
to add- Throws:
NullPointerException
- ifvalidator
is null
public Validator[]
getValidators()
返回此组件实例已注册的 Validator
的集合。如果不存在任何已注册验证器,则返回一个长度为 0 的数组。
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.
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
- TheValidator
to remove
public void
addValueChangeListener(ValueChangeListener listener)
向希望在发生 ValueChangeEvent
时获得通知的侦听器集合中添加一个新的 ValueChangeListener
。
listener |
要添加的 ValueChangeListener |
Throws | NullPointerException:
如果 listener 为 null |
addValueChangeListener
void addValueChangeListener(ValueChangeListener listener)
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
public ValueChangeListener[]
getValueChangeListeners()
返回此组件实例已注册的 ValueChangeListener
的集合。如果不存在任何已注册侦听器,则返回一个长度为 0 的数组。
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.
public void
removeValueChangeListener(ValueChangeListener listener)
从希望在发生 ValueChangeEvent
时获得通知的侦听器集合中移除一个现有的 ValueChangeListener
(如果有)。
listener |
要移除的 ValueChangeListener |
Throws | NullPointerException:
如果 listener 为 null |
removeValueChangeListener
void removeValueChangeListener(ValueChangeListener listener)
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!