Class ComponentTagHandlerDelegate
java.lang.Object
jakarta.faces.view.facelets.TagHandlerDelegate
org.apache.myfaces.view.facelets.tag.faces.ComponentTagHandlerDelegate
Implementation of the tag logic used in the Faces specification.
See org.apache.myfaces.view.facelets.tag.faces.ComponentHandler
- Since:
- 2.0
- Version:
- $Revision$ $Date$
- Author:
- Leonardo Uribe (latest modification by $Author$)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(FaceletContext ctx, UIComponent parent) Method handles UIComponent tree creation in accordance with the Faces 1.2 spec.protected UIComponent
If the binding attribute was specified, use that in conjuction with our componentType String variable to call createComponent on the Application, otherwise just pass the componentType String.createMetaRuleset
(Class type) protected final String
getFacetName
(FaceletContext ctx, UIComponent parent) Return the Facet name we are scoped in, otherwise nullprotected String
getId
(FaceletContext ctx) If the id TagAttribute was specified, get it's value, otherwise generate a unique id from our tagId.
-
Constructor Details
-
ComponentTagHandlerDelegate
-
-
Method Details
-
apply
Method handles UIComponent tree creation in accordance with the Faces 1.2 spec.- First determines this UIComponent's id by calling
getId(FaceletContext)
. - Search the parent for an existing UIComponent of the id we just grabbed
- If found,
mark
its children for deletion. - If not found, call
createComponent
.- Only here do we apply TagHandler#setAttributes(FaceletCompositionContext, Object)
- Set the UIComponent's id
- Set the RendererType of this instance
- Now apply the nextHandler, passing the UIComponent we've created/found.
- Now add the UIComponent to the passed parent
- Lastly, if the UIComponent already existed (found), then #finalizeForDeletion(FaceletCompositionContext, UIComponent) for deletion.
- Specified by:
apply
in classTagHandlerDelegate
- Throws:
TagException
- if the UIComponent parent is nullIOException
- First determines this UIComponent's id by calling
-
getFacetName
Return the Facet name we are scoped in, otherwise null- Parameters:
ctx
-- Returns:
-
createComponent
If the binding attribute was specified, use that in conjuction with our componentType String variable to call createComponent on the Application, otherwise just pass the componentType String.If the binding was used, then set the ValueExpression "binding" on the created UIComponent.
See Application#createComponent(jakarta.faces.el.ValueBinding, jakarta.faces.context.FacesContext, java.lang.String) See Application#createComponent(java.lang.String)- Parameters:
ctx
- FaceletContext to use in creating a component- Returns:
-
getId
If the id TagAttribute was specified, get it's value, otherwise generate a unique id from our tagId. See TagAttribute#getValue(FaceletContext)- Parameters:
ctx
- FaceletContext to use- Returns:
- what should be a unique Id
-
createMetaRuleset
- Specified by:
createMetaRuleset
in classTagHandlerDelegate
-