Class ComponentTagHandlerDelegate
- java.lang.Object
-
- jakarta.faces.view.facelets.TagHandlerDelegate
-
- org.apache.myfaces.view.facelets.tag.faces.ComponentTagHandlerDelegate
-
public class ComponentTagHandlerDelegate extends TagHandlerDelegate
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 Constructor Description ComponentTagHandlerDelegate(ComponentHandler delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(FaceletContext ctx, UIComponent parent)
Method handles UIComponent tree creation in accordance with the Faces 1.2 spec.protected UIComponent
createComponent(FaceletContext ctx)
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.MetaRuleset
createMetaRuleset(Class type)
protected 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 Detail
-
ComponentTagHandlerDelegate
public ComponentTagHandlerDelegate(ComponentHandler delegate)
-
-
Method Detail
-
apply
public void apply(FaceletContext ctx, UIComponent parent) throws IOException
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
protected final String getFacetName(FaceletContext ctx, UIComponent parent)
Return the Facet name we are scoped in, otherwise null- Parameters:
ctx
-- Returns:
-
createComponent
protected UIComponent createComponent(FaceletContext ctx)
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
protected String getId(FaceletContext ctx)
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
public MetaRuleset createMetaRuleset(Class type)
- Specified by:
createMetaRuleset
in classTagHandlerDelegate
-
-