uicomponentclassictagbase.html

来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 1,186 行 · 第 1/5 页

HTML
1,186
字号
 with our nearest enclosing <A HREF="../../../javax/faces/webapp/UIComponentTag.html" title="class in javax.faces.webapp"><CODE>UIComponentTag</CODE></A>.  The process for locating or creating the component is:</p> <ol> <li>If we have previously located this component, return it.</li> <li>Locate the parent component by looking for a parent     <A HREF="../../../javax/faces/webapp/UIComponentTag.html" title="class in javax.faces.webapp"><CODE>UIComponentTag</CODE></A> instance, and ask it for its component.     If there is no parent <A HREF="../../../javax/faces/webapp/UIComponentTag.html" title="class in javax.faces.webapp"><CODE>UIComponentTag</CODE></A> instance, this tag     represents the root component, so get it from the current     <code>Tree</code> and return it.</li> <li>If this <A HREF="../../../javax/faces/webapp/UIComponentTag.html" title="class in javax.faces.webapp"><CODE>UIComponentTag</CODE></A> instance has the     <code>facetName</code> attribute set, ask the parent     <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A> for a facet with this name.  If not found,     create one, call <code>setProperties()</code> with the new     component as a parameter, and register it under this name.     Return the found or created facet <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A>.</li> <li>Determine the component id to be assigned to the new     component, as follows:  if this <A HREF="../../../javax/faces/webapp/UIComponentTag.html" title="class in javax.faces.webapp"><CODE>UIComponentTag</CODE></A> has     an <code>id</code> attribute set, use that value; otherwise,     generate an identifier that is guaranteed to be the same for     this <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A> every time this page is processed     (i.e. one based on the location of all <A HREF="../../../javax/faces/webapp/UIComponentTag.html" title="class in javax.faces.webapp"><CODE>UIComponentTag</CODE></A>     instances without an <code>id</code> attribute set).</li> <li>Ask the parent <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A> for a child with this identifier.     If not found, create one, call <code>setProperties()</code>     with the new component as a parameter, and register it as a child     with this identifier.  Return the found or created     child <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A>.</li> </ol> <p>When creating a component, the process is:</p> <ol> <li>Retrieve the component type by calling <A HREF="../../../javax/faces/webapp/UIComponentTagBase.html#getComponentType()"><CODE>UIComponentTagBase.getComponentType()</CODE></A></li> <li>If the component has a <code>binding</code> attribute, create an expression from it, and call <A HREF="../../../javax/faces/application/Application.html#createComponent(java.lang.String)"><CODE>Application.createComponent(java.lang.String)</CODE></A> with that expression, the <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A>, and the component type.  Store the expression using the key <code>"binding"</code>.</li> <li>Otherwise, call <A HREF="../../../javax/faces/application/Application.html#createComponent(java.lang.String)"><CODE>Application.createComponent(java.lang.String)</CODE></A> with only the component type. <li>Call <code>setProperties()</code>. <li>Add the new component as a child or facet of its parent</li> </ol><P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/servlet/jsp/JspException.html" title="class in javax.servlet.jsp">JspException</A></CODE></DL></DD></DL><HR><A NAME="getParentUIComponentClassicTagBase(javax.servlet.jsp.PageContext)"><!-- --></A><H3>getParentUIComponentClassicTagBase</H3><PRE>public static <A HREF="../../../javax/faces/webapp/UIComponentClassicTagBase.html" title="class in javax.faces.webapp">UIComponentClassicTagBase</A> <B>getParentUIComponentClassicTagBase</B>(<A HREF="../../../javax/servlet/jsp/PageContext.html" title="class in javax.servlet.jsp">PageContext</A>&nbsp;context)</PRE><DL><DD><p>Locate and return the nearest enclosing <A HREF="../../../javax/faces/webapp/UIComponentClassicTagBase.html" title="class in javax.faces.webapp"><CODE>UIComponentClassicTagBase</CODE></A> if any; otherwise, return <code>null</code>.</p><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - <code>PageContext</code> for the current page</DL></DD></DL><HR><A NAME="getIndexOfNextChildTag()"><!-- --></A><H3>getIndexOfNextChildTag</H3><PRE>protected int <B>getIndexOfNextChildTag</B>()</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/webapp/UIComponentTagBase.html#getIndexOfNextChildTag()">UIComponentTagBase</A></CODE></B></DD><DD><p>Return the index of the next child to be added as a child of this tag.  The default implementation maintains a list of created components and returns the size of the list.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/webapp/UIComponentTagBase.html#getIndexOfNextChildTag()">getIndexOfNextChildTag</A></CODE> in class <CODE><A HREF="../../../javax/faces/webapp/UIComponentTagBase.html" title="class in javax.faces.webapp">UIComponentTagBase</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="addChild(javax.faces.component.UIComponent)"><!-- --></A><H3>addChild</H3><PRE>protected void <B>addChild</B>(<A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A>&nbsp;child)</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/webapp/UIComponentTagBase.html#addChild(javax.faces.component.UIComponent)">UIComponentTagBase</A></CODE></B></DD><DD><p>Add the component identifier of the specified <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A> to the list of component identifiers created or located by nested <A HREF="../../../javax/faces/webapp/UIComponentTag.html" title="class in javax.faces.webapp"><CODE>UIComponentTag</CODE></A>s processing this request.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/webapp/UIComponentTagBase.html#addChild(javax.faces.component.UIComponent)">addChild</A></CODE> in class <CODE><A HREF="../../../javax/faces/webapp/UIComponentTagBase.html" title="class in javax.faces.webapp">UIComponentTagBase</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>child</CODE> - New child whose identifier should be added</DL></DD></DL><HR><A NAME="addFacet(java.lang.String)"><!-- --></A><H3>addFacet</H3><PRE>protected void <B>addFacet</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;name)</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/webapp/UIComponentTagBase.html#addFacet(java.lang.String)">UIComponentTagBase</A></CODE></B></DD><DD><p>Add the facet name of the specified facet to the list of facet names created or located by nested <A HREF="../../../javax/faces/webapp/UIComponentTag.html" title="class in javax.faces.webapp"><CODE>UIComponentTag</CODE></A>s processing this request.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/webapp/UIComponentTagBase.html#addFacet(java.lang.String)">addFacet</A></CODE> in class <CODE><A HREF="../../../javax/faces/webapp/UIComponentTagBase.html" title="class in javax.faces.webapp">UIComponentTagBase</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - Facet name to be added</DL></DD></DL><HR><A NAME="createVerbatimComponentFromBodyContent()"><!-- --></A><H3>createVerbatimComponentFromBodyContent</H3><PRE>protected <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A> <B>createVerbatimComponentFromBodyContent</B>()</PRE><DL><DD><p>Create 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.</p><P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="createVerbatimComponent()"><!-- --></A><H3>createVerbatimComponent</H3><PRE>protected <A HREF="../../../javax/faces/component/UIOutput.html" title="class in javax.faces.component">UIOutput</A> <B>createVerbatimComponent</B>()</PRE><DL><DD><p>Use the <A HREF="../../../javax/faces/application/Application.html" title="class in javax.faces.application"><CODE>Application</CODE></A> instance to create a new component with the following characteristics.</p> <p><code>componentType</code> is <code>javax.faces.HtmlOutputText</code>.</p> <p><code>transient</code> is <code>true</code>.</p> <p><code>escape</code> is <code>false</code>.</p> <p><code>id</code> is <code>FacesContext.getViewRoot().createUniqueId()</code></p><P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="addVerbatimBeforeComponent(javax.faces.webapp.UIComponentClassicTagBase, javax.faces.component.UIComponent, javax.faces.component.UIComponent)"><!-- --></A><H3>addVerbatimBeforeComponent</H3><PRE>protected void <B>addVerbatimBeforeComponent</B>(<A HREF="../../../javax/faces/webapp/UIComponentClassicTagBase.html" title="class in javax.faces.webapp">UIComponentClassicTagBase</A>&nbsp;parentTag,                                          <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A>&nbsp;verbatim,                                          <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A>&nbsp;component)</PRE><DL><DD><p>Add <i>verbatim</i> as a sibling of <i>component</i> in <i>component</i> in the parent's child list.  <i>verbatim</i> is added to the list at the position immediatly preceding <i>component</i>.</p><P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="addVerbatimAfterComponent(javax.faces.webapp.UIComponentClassicTagBase, javax.faces.component.UIComponent, javax.faces.component.UIComponent)"><!-- --></A><H3>addVerbatimAfterComponent</H3><PRE>protected void <B>addVerbatimAfterComponent</B>(<A HREF="../../../javax/faces/webapp/UIComponentClassicTagBase.html" title="class in javax.faces.webapp">UIComponentClassicTagBase</A>&nbsp;parentTag,                                         <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A>&nbsp;verbatim,                                         <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A>&nbsp;component)</PRE><DL><DD><p>Add <i>verbatim</i> as a sibling of <i>component</i> in <i>component</i> in the parent's child list.  <i>verbatim</i> is added to the list at the position immediatly following <i>component</i>.</p><P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="doStartTag()"><!-- --></A><H3>doStartTag</H3><PRE>public int <B>doStartTag</B>()               throws <A HREF="../../../javax/servlet/jsp/JspException.html" title="class in javax.servlet.jsp">JspException</A></PRE><DL><DD><p>Perform any processing necessary to find (or create) the <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A> instance in the view corresponding to this tag instance in the page and, if and only if a component was created, insert it into the tree at the proper location as expected by the page author.  Secondarily, cause a transient <A HREF="../../../javax/faces/component/UIOutput.html" title="class in javax.faces.component"><CODE>UIOutput</CODE></A> component to be created and placed in the tree <b>before</b> the <code>UIComponent</code> instance for <b>this</b> tag.  The value of this <code>UIOutput</code> component must include anything covered by <code>CASE 1</code> or <code>CASE 2</code> in the class description.</p> <p>The default implementation, which is intended to be suf

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?