UIComponentTagBase is the base class
for all JSP tags that use the "classic" JSP tag interface that
correspond to a javax.faces.component.UIComponent instance in
the view. In Faces 1.2, all component tags are BodyTag
instances to allow for the execution of the page to build the
component tree, but not render it. Rendering happens only after the
component tree is completely built.
UIComponentTag extends
UIComponentClassicTagBase to add support for properties
that conform to the Faces 1.1 EL.
UIComponentELTag extends
UIComponentClassicTagBase class to add support for
properties that conform to the EL API.
The default implementation allows the proper interweaving of template text, non-Faces JSP tag output, and Faces component tag output in the same page, as expected by the page author.
The CASE markers in the following example will be cited in the method descriptions of this class.
CASE 1 describes template text and/or non-component custom tag output occurring as the child of a component tag, but before the first component tag child of that component tag.
CASE 2 describes template text and/or non-component custom tag output occurring between two sibling component tags.
CASE 3 describes template text and/or non-component custom tag output occurring as the child content of an <f:verbatim> tag at any point in the page.
CASE 4 describes template text and/or non-component custom tag output occurring between the last child component tag and its enclosing parent component tag's end tag.
<h:panelGrid style="color:red" border="4" columns="2">
CASE 1
<h:outputText value="component 1"/>
CASE 2
<h:outputText value="component 2"/>
<f:verbatim>CASE 3</f:verbatim>
<c:out value="${pageScope.CASE4}" />
</h:panelGrid>
The preceding arrangement of faces component tags, must yield
markup that will render identically to the following (assuming that
${pageScope.CASE4} evaluates to "CASE 4"
without the quotes).
<table border="4" style="color:red">
<tbody>
<tr><td>CASE 1</td></tr> <tr><td>component 1</td></tr>
<tr><td>CASE 2</td> <tr><td>component 2</td></tr>
<tr><td>CASE 3</td> <td>CASE 4</td></tr>
</tbody>
</table>
| Modifier and Type | Field and Description |
|---|---|
| private int | _nextChildIndex
The next child index to get in getChild() |
| protected BodyContent | bodyContent
The |
| private UIComponent | component
The |
| private static final String | COMPONENT_TAG_STACK_ATTR
The facesContext scope attribute under which a component tag stack for the current facesContext will be maintained. |
| private FacesContext | context
The |
| private boolean | created
Was a new component instance dynamically created when our
|
| private List | createdComponents
The |
| private List | createdFacets
The |
| private static final String | CURRENT_FACES_CONTEXT
The attribute name under which we will store the |
| private static final String | CURRENT_VIEW_ROOT
The attribute name under which we will store the |
| private String | facesJspId
This is simply the jspId prefixed by |
| private static final String | GLOBAL_ID_VIEW
The attribute name under which we will store all |
| private String | id
The component identifier for the associated component. |
| private boolean | isNestedInIterator
Set to true if this component is nested inside of an iterating tag |
| private static final String | JAVAX_FACES_PAGECONTEXT_COUNTER
This is a |
| private static final String | JAVAX_FACES_PAGECONTEXT_MARKER
This is a |
| private static final String | JSP_CREATED_COMPONENT_IDS
The |
| private static final String | JSP_CREATED_FACET_NAMES
The |
| private String | |
| pack-priv Map | |
| protected PageContext | pageContext
The JSP |
| private Tag | parent
The JSP |
| private UIComponentClassicTagBase | parentTag
Caches the nearest enclosing |
| private static final String | PREVIOUS_JSP_ID_SET
Used to store the previousJspId Map in facesContextScope |
| protected static final String | UNIQUE_ID_PREFIX
Used as the prefix for ids. |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static UIComponentClassicTagBase | |
| private static UIComponentClassicTagBase | |
| private static int | Returns: The index at which the value was first found, or -1 if not foundList to seatch list, int index to start searching for value from startIndex, Object Value to search for (null not supported) searchValue)Similar to List.indexOf, except that we start searching from a specific index and then wrap aroud. |
| protected void | addChild(UIComponent
New child whose identifier should be added child)Implements abstract javax. Add the component identifier of the specified |
| pack-priv void | |
| protected void | addFacet(String
Facet name to be added name)Implements abstract javax. Add the facet name of the specified facet to the list of
facet names created or located by nested |
| protected void | addVerbatimAfterComponent(UIComponentClassicTagBase
the parent tag parentTag, UIComponent the verbatim to add after the component verbatim, UIComponent the component to be added before the component component)Add verbatim as a sibling of component in component in the parent's child list. |
| protected void | addVerbatimBeforeComponent(UIComponentClassicTagBase
the parent tag parentTag, UIComponent the verbatim to add before the component verbatim, UIComponent the component to be added after the component component)Add verbatim as a sibling of component in component in the parent's child list. |
| private UIComponent | createChild(FacesContext
FacesContext for the current requestParent parent, UIComponentClassicTagBase parentTag, String UIComponent for the new childComponent identifier for the new child,
or componentId)null for no explicit identifierCreate a new child component using |
| protected abstract UIComponent | Returns: the created componentFacesContext for the current requestid of the component newId)Create and return a new child component of the type returned
by calling |
| private UIComponent | createFacet(FacesContext
FacesContext for the current requestParent parent, String UIComponent of the new facetName of the new facet name, String id of the new facet newId)Create a new child component using |
| private String | |
| protected UIOutput | Returns: the componentUse the |
| protected UIComponent | Returns: the componentCreate a transient UIOutput component from the body content, of this tag instance or return null if there is no body content, the body content is whitespace, or the body content is a comment. |
| public int | doAfterBody()
Implements javax. Perform any processing necessary to handle the content implications of CASE 4 in the class description. |
| public int | doEndTag()
Implements javax. Perform any processing necessary to handle the content implications of CASE 3 in the class description. |
| public void | doInitBody()
Implements javax. Prepare for evaluation of the body. |
| public int | doStartTag()
Implements javax. Perform any processing necessary to find (or create) the
|
| protected void | encodeBegin()
Deprecated
No encoding is done during JSP page execution.
Encoding is deferred until the page has completed executing to
allow the entire tree to be built before any encoding occurs.
Delegate to the |
| protected void | encodeChildren()
Deprecated
No encoding is done during JSP page execution.
Encoding is deferred until the page has completed executing to
allow the entire tree to be built before any encoding occurs.
Delegate to the |
| protected void | encodeEnd()
Deprecated
No encoding is done during JSP page execution.
Encoding is deferred until the page has completed executing to
allow the entire tree to be built before any encoding occurs.
Delegate to the |
| protected UIComponent | Returns: the found componentthe context)FacesContext for the current request.Find and return the |
| private String | |
| public BodyContent | |
| private static UIComponent | getChild(UIComponentClassicTagBase tag, UIComponent
UIComponent to be searchedComponent id to search for componentId)Return a child with the specified component id from the specified
component, if any; otherwise, return |
| public UIComponent | getComponentInstance()
Implements abstract javax. Return the |
| public boolean | getCreated()
Implements abstract javax. Return |
| protected List | Returns: the created componentsReturns the |
| protected int | Returns: the value to return fromdoAfterBody()Return the flag value that should be returned from the
|
| protected int | Returns: the value to return fromdoEnd()Return the flag value that should be returned from the
|
| protected int | Returns: the value to return fromdoStart()Return the flag value that should be returned from the
|
| protected FacesContext | getFacesContext()
Implements abstract javax. Return the |
| private static FacesContext | |
| protected String | Returns: the value as specified aboveIf this method has been called before on this tag's useful
lifetime (before |
| protected String | Returns: the name of the facetReturn the facet name that we should be stored under, if any; otherwise, return null (indicating that we will be a child component). |
| protected String | |
| protected int | getIndexOfNextChildTag()
Implements abstract javax. Return the index of the next child to be added as a child of this tag. |
| public String | |
| private Map | |
| public Tag | getParent()
Implements javax. Return the |
| private UIComponentClassicTagBase | Returns: the parent tag that represents the closest NamingContainer component.
|
| public static UIComponentClassicTagBase | Returns: the parent tagPageContext for the current pageLocate and return the nearest enclosing |
| public JspWriter | |
| protected abstract boolean | Returns: whether or not this component has a binding attributeReturn |
| private static void | |
| private boolean | Returns: true if this nested withfacesJspId is duplicate.id to be looked up for possible
duplication.Returns true if a component already exists with the same
|
| private boolean | Returns: true if this ID is unique within the closest naming
container, otherwise falsethe component ID id)
|
| private void | popUIComponentClassicTagBase()
Pop the top |
| private static void | |
| private void | pushUIComponentClassicTagBase()
Push the specified |
| public void | release()
Implements javax. Release any resources allocated during the execution of this tag handler. |
| private void | removeOldChildren()
Retrieve from the |
| private void | removeOldFacets()
Retrieve from the |
| public void | setBodyContent(BodyContent
The new bodyContent)BodyContent for this tagImplements javax. Set the |
| public void | setId(String
The new component identifier. This may not start with
id)UIViewRoot#UNIQUE_ID_PREFIX.Implements abstract javax. Set the component identifier for our component. |
| public void | setJspId(String
the container generated id for this tag, guaranteed to
be unique within the page. id)Implements javax. Defined on |
| public void | setPageContext(PageContext
The enclosing pageContext)PageContextImplements javax. Set the |
| public void | setParent(Tag
The new parent parent)TagImplements javax. Set the |
| protected abstract void | setProperties(UIComponent
UIComponent whose properties are to be
overriddenOverride properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set. |
| protected void | setupResponseWriter()
Set up the |
| private void | updatePreviousJspIdAndIteratorStatus(String
the id to be compared with the previous id, if any, for
this tag instance on this request. id)Called from |