|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.webapp.UIComponentTag
UIComponentTag is a base class for all JSP custom
actions that correspond to user interface components in a page that is
rendered by JavaServer Faces. Tags that need to process their tag bodies
should subclass UIComponentBodyTag instead.
The id attribute of a UIComponentTag is
used to set the componentId property of the UIComponent
associated with this tag.
| Field Summary | |
protected FacesContext |
context
The FacesContext for the request being processed, if any. |
protected java.lang.String |
id
The component identifier for the associated component. |
protected PageContext |
pageContext
The JSP PageContext for the page we are embedded in. |
protected boolean |
rendered
An override for the rendered attribute associated with our UIComponent, if not true. |
protected boolean |
renderedSet
Flag indicating whether the rendered attribute was
set on this tag instance. |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
| Constructor Summary | |
UIComponentTag()
|
|
| Method Summary | |
int |
doEndTag()
Render the ending of the UIComponent that is associated
with this tag (via the id attribute), by following these
steps. |
int |
doStartTag()
Render the beginning of the UIComponent that is associated
with this tag (via the id attribute), by following these
steps. |
protected void |
encodeBegin()
Delegate to the encodeBegin() method of our
corresponding UIComponent. |
protected void |
encodeChildren()
Delegate to the encodeChildren() method of our
corresponding UIComponent. |
protected void |
encodeEnd()
Delegate to the encodeEnd() method of our
corresponding UIComponent. |
protected UIComponent |
findComponent(FacesContext context)
Find and return the UIComponent, from the component
tree, that corresponds to this tag handler instance. |
protected int |
getChildIndex()
Return the current index into the children of this tag's corresponding UIComponent. |
UIComponent |
getComponent()
Return the UIComponent instance that is associated with
this tag instance. |
protected abstract java.lang.String |
getComponentType()
Returns the componentType for the component that is or will be bound to this tag. |
boolean |
getCreated()
Return true if we dynamically created a new component
instance during execution of this tag. |
protected int |
getDoEndValue()
Return the flag value that should be returned from the doEnd() method when it is called. |
protected int |
getDoStartValue()
Return the flag value that should be returned from the doStart() method when it is called. |
protected java.lang.String |
getFacetName()
Return the facet name that we should be stored under, if any; otherwise, return null (indicating that we will be a child component). |
Tag |
getParent()
Return the Tag that is the parent of this instance. |
protected UIComponentTag |
getParentUIComponentTag()
Locate and return the nearest enclosing UIComponentTag if any;
otherwise, return null. |
abstract java.lang.String |
getRendererType()
Return the rendererType property that selects the
Renderer to be used for encoding this component, or
null to ask the component to render itself directly. |
protected void |
incrementChildIndex()
Increment the index into the children of this tag's component. |
protected boolean |
isSuppressed()
Return true if rendering should be suppressed because
our component is a facet, or some parent component has been configured
with getRendersChildren() as true. |
protected void |
overrideProperties(UIComponent component)
Override properties of the specified component if the corresponding properties of this tag handler were explicitly set, and the corresponding attribute of the component is not set. |
void |
release()
Release any resources allocated during the execution of this tag handler. |
void |
setId(java.lang.String id)
Set the component identifier for our component. |
void |
setPageContext(PageContext pageContext)
Set the PageContext of the page containing this
tag instance. |
void |
setParent(Tag parent)
Set the Tag that is the parent of this instance. |
void |
setRendered(boolean rendered)
Set an override for the rendered attribute. |
protected void |
setupResponseWriter()
Set up the ResponseWriter for the current response,
if this has not been done already. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected FacesContext context
The FacesContext for the request being processed, if any.
protected PageContext pageContext
The JSP PageContext for the page we are embedded in.
protected java.lang.String id
The component identifier for the associated component.
protected boolean rendered
An override for the rendered attribute associated with our
UIComponent, if not true.
protected boolean renderedSet
Flag indicating whether the rendered attribute was
set on this tag instance.
| Constructor Detail |
public UIComponentTag()
| Method Detail |
public void setId(java.lang.String id)
Set the component identifier for our component.
id - The new component identifierpublic void setRendered(boolean rendered)
Set an override for the rendered attribute.
rendered - The new value for rendered attributeprotected abstract java.lang.String getComponentType()
Returns the componentType for the component that is or will be bound to this tag.
Application.getComponent(java.lang.String) to create the
UIComponent instance for this tag.public UIComponent getComponent()
Return the UIComponent instance that is associated with
this tag instance. This method is designed to be used by tags nested
within this tag, and only returns useful results between the
execution of doStartTag() and doEndTag()
on this tag instance.
public boolean getCreated()
Return true if we dynamically created a new component
instance during execution of this tag. This method is designed to be
used by tags nested within this tag, and only returns useful results
between the execution of doStartTag() and
doEndTag() on this tag instance.
public abstract java.lang.String getRendererType()
Return the rendererType property that selects the
Renderer to be used for encoding this component, or
null to ask the component to render itself directly.
Subclasses must override this method to return the appropriate value.
public void setPageContext(PageContext pageContext)
Set the PageContext of the page containing this
tag instance.
setPageContext in interface TagpageContext - The enclosing PageContextpublic Tag getParent()
Return the Tag that is the parent of this instance.
getParent in interface TagTagSupport.findAncestorWithClass(javax.servlet.jsp.tagext.Tag, java.lang.Class)public void setParent(Tag parent)
Set the Tag that is the parent of this instance.
In addition, locate the closest enclosing UIComponentTag and
increment its numChildren counter. Finally, save our
childIndex as
(enclosingUIComponentTag.numChildren - 1).
setParent in interface Tagparent - The new parent Tag
public int doStartTag()
throws JspException
Render the beginning of the UIComponent that is associated
with this tag (via the id attribute), by following these
steps.
ResponseWriter is associated
with the current FacesContext. This ensures that encoded
output from the components is routed through the
JspWriter for the current page.encodeBegin() method of the component,
unless rendering is suppressed or our component renders its
own children.The flag value to be returned is acquired by calling the
getDoStartValue() method, which tag subclasses may
override if they do not want the default value.
doStartTag in interface TagJspException - if an error occursBodyTag
public int doEndTag()
throws JspException
Render the ending of the UIComponent that is associated
with this tag (via the id attribute), by following these
steps.
rendersChildren property of this component is
true, call the encodeBegin() method
of this component.
rendersChildren property of this component is
true, call the encodeChildren() method
of the component.encodeEnd() method of the component.The flag value to be returned is acquired by calling the
getDoEndValue() method, which tag subclasses may
override if they do not want the default value.
doEndTag in interface TagJspException - if an error occurspublic void release()
Release any resources allocated during the execution of this tag handler.
release in interface Tag
protected void encodeBegin()
throws java.io.IOException
Delegate to the encodeBegin() method of our
corresponding UIComponent. This method is called from
doStartTag(). Normally, delegation occurs unconditionally;
however, this method is abstracted out so that advanced tags can
conditionally perform this call.
java.io.IOException - if an input/output error occurs
protected void encodeChildren()
throws java.io.IOException
Delegate to the encodeChildren() method of our
corresponding UIComponent. This method is called from
doStartTag(). Normally, delegation occurs unconditionally;
however, this method is abstracted out so that advanced tags can
conditionally perform this call.
java.io.IOException - if an input/output error occurs
protected void encodeEnd()
throws java.io.IOException
Delegate to the encodeEnd() method of our
corresponding UIComponent. This method is called from
doStartTag(). Normally, delegation occurs unconditionally;
however, this method is abstracted out so that advanced tags can
conditionally perform this call.
java.io.IOException - if an input/output error occurs
protected UIComponent findComponent(FacesContext context)
throws JspException
Find and return the UIComponent, from the component
tree, that corresponds to this tag handler instance. If there
is no such UIComponent, create one by calling
getComponent(), and add it is a child or facet
of the UIComponent associated with our nearest enclosing
UIComponentTag.
JspExceptionprotected int getChildIndex()
Return the current index into the children of this tag's
corresponding UIComponent.
protected int getDoEndValue()
throws JspException
Return the flag value that should be returned from the
doEnd() method when it is called. Subclasses
may override this method to return the appropriate value.
JspException - to cause doEnd() to
throw an exception
protected int getDoStartValue()
throws JspException
Return the flag value that should be returned from the
doStart() method when it is called. Subclasses
may override this method to return the appropriate value.
JspException - to cause doStart() to
throw an exceptionprotected java.lang.String getFacetName()
Return the facet name that we should be stored under, if any; otherwise, return null (indicating that we will be a child component).
protected UIComponentTag getParentUIComponentTag()
Locate and return the nearest enclosing UIComponentTag if any;
otherwise, return null.
protected void incrementChildIndex()
Increment the index into the children of this tag's component.
protected boolean isSuppressed()
Return true if rendering should be suppressed because
our component is a facet, or some parent component has been configured
with getRendersChildren() as true.
protected void overrideProperties(UIComponent component)
Override properties of the specified component if the corresponding properties of this tag handler were explicitly set, and the corresponding attribute of the component is not set.
Tag subclasses that want to support additional override properties
must ensure that the base class overrideProperties()
method is still called. A typical implementation that supports
extra properties foo and bar would look
something like this:
protected void overrideProperties(UIComponent component) {
super.overrideProperties(component);
if (foo != null) {
component.setAttribute("foo", foo);
}
if (bar != null) {
component.setAttribute("bar", bar);
}
}
protected void setupResponseWriter()
Set up the ResponseWriter for the current response,
if this has not been done already.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||