ValueHolder (Java EE 5)

Java EE API


javax.faces.component Interface ValueHolder

All Known Subinterfaces:
EditableValueHolder
All Known Implementing Classes:
HtmlInputHidden, HtmlInputSecret, HtmlInputText, HtmlInputTextarea, HtmlOutputFormat, HtmlOutputLabel, HtmlOutputLink, HtmlOutputText, HtmlSelectBooleanCheckbox, HtmlSelectManyCheckbox, HtmlSelectManyListbox, HtmlSelectManyMenu, HtmlSelectOneListbox, HtmlSelectOneMenu, HtmlSelectOneRadio, UIInput, UIOutput, UISelectBoolean, UISelectMany, UISelectOne

public interface ValueHolder

Implemented by: EditableValueHolder, UIOutput

ValueHolder 是可以由任何希望支持本地值以及通过值表达式 访问模型层中的数据,并支持在 String 和模型层数据的本机数据类型之间转换的具体 UIComponent 实现的接口。

英文文档:

ValueHolder is an interface that may be implemented by any concrete UIComponent that wishes to support a local value, as well as access data in the model tier via a value expression, and support conversion between String and the model tier data's native data type.


Method Summary
 Converter
 Object
 Object
 void
 void
 

Method Detail

public Object getLocalValue()

返回此 UIComponent 的本地值(如果有),不用对任何关联的 ValueExpression 求值。

英文文档:

getLocalValue

Object getLocalValue()

Return the local value of this UIComponent (if any), without evaluating any associated ValueExpression.


public Object getValue()

获取此 UIComponent 的值。首先,参考此组件的本地值属性。如果为非 null,则将其返回。如果为 null,则查看我们是否有 value 属性的 ValueExpression。如果有,则返回对属性求值的结果,否则返回 null。请注意,因为 UIComponent#setValueBinding 规范要求调用 UIComponent#setValueExpression,所以遗留标记将继续起作用。

英文文档:

getValue

Object getValue()

Gets the value of this UIComponent. First, consult the local value property of this component. If non-null return it. If null, see if we have a ValueExpression for the value property. If so, return the result of evaluating the property, otherwise return null. Note that because the specification for UIComponent.setValueBinding(java.lang.String, javax.faces.el.ValueBinding) requires a call through to UIComponent.setValueExpression(java.lang.String, javax.el.ValueExpression), legacy tags will continue to work.


public void setValue(Object value)

设置此 UIComponent 的值(如果有)。

value 新的本地值
英文文档:

setValue

void setValue(Object value)

Set the value of this UIComponent (if any).

Parameters:
value - The new local value

public Converter getConverter()

返回为此 UIComponent 注册的 Converter(如果有)。

英文文档:

getConverter

Converter getConverter()

Return the Converter (if any) that is registered for this UIComponent.


public void setConverter(Converter converter)

设置为此 UIComponent 注册的 Converter(如果有)。

converter 新的 Converter(或 null
英文文档:

setConverter

void setConverter(Converter converter)

Set the Converter (if any) that is registered for this UIComponent.

Parameters:
converter - New Converter (or null)


Submit a bug or feature

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

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

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