|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.faces.webapp Class UIComponentELTag
java.lang.Object javax.faces.webapp.UIComponentTagBase javax.faces.webapp.UIComponentClassicTagBase javax.faces.webapp.UIComponentELTag
- All Implemented Interfaces:
- BodyTag, IterationTag, JspIdConsumer, JspTag, Tag
public abstract class UIComponentELTag
- extends UIComponentClassicTagBase
- implements Tag
UIComponentELTag
使其超类专门化,以允许属性从 EL API 表达式中获取值。
此标记设计用于 Faces 1.2 版本和 JSP 2.1 版本的容器。
UIComponentELTag
specializes its superclass to allow for
properties that take their values from EL API expressions.
This tag is designed for use with Faces version 1.2 and JSP version 2.1 containers.
Field Summary |
---|
Fields inherited from class javax.faces.webapp.UIComponentClassicTagBase |
---|
bodyContent, pageContext, UNIQUE_ID_PREFIX |
Fields inherited from class javax.faces.webapp.UIComponentTagBase |
---|
log |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Constructor Summary | |
---|---|
UIComponentELTag()
|
Method Summary | |
---|---|
protected UIComponent |
createComponent(FacesContext context,
String newId)
Create and return a new child component of the type returned by calling getComponentType() . |
protected ELContext |
getELContext()
Return the ELContext for the FacesContext for
this request. |
protected boolean |
hasBinding()
Return true if this component has a
non-null binding attribute. |
void |
release()
Release any resources allocated during the execution of this tag handler. |
void |
setBinding(ValueExpression binding)
Set the value expression for our component. |
protected void |
setProperties(UIComponent component)
Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set. |
void |
setRendered(ValueExpression rendered)
Set an override for the rendered attribute. |
Methods inherited from class javax.faces.webapp.UIComponentTagBase |
---|
getComponentType, getRendererType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
doEndTag, doStartTag, getParent, setPageContext, setParent |
Constructor Detail |
---|
public
UIComponentELTag()
英文文档:
UIComponentELTag
public UIComponentELTag()
Method Detail |
---|
public void
setBinding(ValueExpression binding) throws JspException
设置组件的值表达式。
binding | 新的值表达式 |
Throws | JspException: 如果发生错误 |
setBinding
public void setBinding(ValueExpression binding) throws JspException
Set the value expression for our component.
- Parameters:
binding
- The new value expression- Throws:
JspException
- if an error occurs
protected boolean
hasBinding()
英文文档:
hasBinding
protected boolean hasBinding()
- Description copied from class:
UIComponentClassicTagBase
Return
true
if this component has a non-null
binding attribute. This method is necessary to allow subclasses that expose thebinding
property as an Faces 1.1 style EL property as well as subclasses that expose it as an EL API property.- Specified by:
hasBinding
in classUIComponentClassicTagBase
public void
setRendered(ValueExpression rendered)
为呈现的属性设置重写。
rendered | 呈现属性的新值 |
setRendered
public void setRendered(ValueExpression rendered)
Set an override for the rendered attribute.
- Parameters:
rendered
- The new value for rendered attribute
protected ELContext
getELContext()
返回此请求的 FacesContext
的 ELContext
。
这是 getFacesContext().getELContext()
的便捷方法。
getELContext
protected ELContext getELContext()
Return the
ELContext
for theFacesContext
for this request.This is a convenience for
getFacesContext().getELContext()
.- Overrides:
getELContext
in classUIComponentTagBase
public void
release()
释放执行此标记处理程序期间分配的所有资源。
release
public void release()
Release any resources allocated during the execution of this tag handler.
- Specified by:
release
in interfaceTag
- Overrides:
release
in classUIComponentClassicTagBase
protected void
setProperties(UIComponent component)
如果明确设置了此标记处理程序实例相应的属性,则重写指定组件的属性。仅当指定的 UIComponent
在执行此标记处理器实例期间实际创建时,才调用此方法,此调用将在向视图添加 UIComponent
之前发生。
希望支持其他设置属性的标记子类必须确保仍然调用了基类 setProperties()
方法。支持额外属性 foo
和 bar
的典型实现如下所示:
protected void setProperties(UIComponent component) { super.setProperties(component); if (foo != null) { component.setAttribute("foo", foo); } if (bar != null) { component.setAttribute("bar", bar); } }
默认实现重写以下属性:
rendered
- 为此标记处理程序实例指定了rendered
属性的值时设置。rendererType
-getRendererType()
方法返回非 null 值时设置。
component |
要重写属性的 UIComponent |
setProperties
protected void setProperties(UIComponent component)
Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set. This method must be called ONLY if the specified
UIComponent
was in fact created during the execution of this tag handler instance, and this call will occur BEFORE theUIComponent
is added to the view.Tag subclasses that want to support additional set properties must ensure that the base class
setProperties()
method is still called. A typical implementation that supports extra propertiesfoo
andbar
would look something like this:protected void setProperties(UIComponent component) { super.setProperties(component); if (foo != null) { component.setAttribute("foo", foo); } if (bar != null) { component.setAttribute("bar", bar); } }
The default implementation overrides the following properties:
rendered
- Set if a value for therendered
property is specified for this tag handler instance.rendererType
- Set if thegetRendererType()
method returns a non-null value.
- Specified by:
setProperties
in classUIComponentClassicTagBase
- Parameters:
component
-UIComponent
whose properties are to be overridden
protected UIComponent
createComponent(FacesContext context, String newId) throws JspException
创建并返回新的类型(通过调用 getComponentType()
返回)子组件。如果此 UIComponentELTag
拥有非 null 的 binding
属性,则使用为 binding
属性创建的 ValueExpression
调用 Application#createComponent
实现,该 ValueExpression
将被存储在组件中。否则,调用 Application#createComponent
,只有组件类型参数。最后,初始化组件 ID 和其他属性。
context |
当前请求的 FacesContext |
newId | 组件的 ID |
createComponent
protected UIComponent createComponent(FacesContext context, String newId) throws JspException
Create and return a new child component of the type returned by calling
getComponentType()
. If thisUIComponentELTag
has a non-nullbinding
attribute, this is done by callApplication.createComponent(java.lang.String)
with theValueExpression
created for thebinding
attribute, and theValueExpression
will be stored on the component. Otherwise,Application.createComponent(java.lang.String)
is called with only the component type. Finally, initialize the components id and other properties.- Specified by:
createComponent
in classUIComponentClassicTagBase
- Parameters:
context
-FacesContext
for the current requestnewId
- id of the component- Throws:
JspException
|
|||||||||
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 : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!