org.apache.myfaces.view.facelets.tag.jsf
Class ComponentTagHandlerDelegate

java.lang.Object
  extended by javax.faces.view.facelets.TagHandlerDelegate
      extended by org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate

public class ComponentTagHandlerDelegate
extends TagHandlerDelegate

Implementation of the tag logic used in the JSF specification.

Since:
2.0
Version:
$Revision: 1424976 $ $Date: 2012-12-21 10:41:52 -0500 (Fri, 21 Dec 2012) $
Author:
Leonardo Uribe (latest modification by $Author: lu4242 $)
See Also:
ComponentHandler

Constructor Summary
ComponentTagHandlerDelegate(ComponentHandler delegate)
           
 
Method Summary
 void apply(FaceletContext ctx, UIComponent parent)
          Method handles UIComponent tree creation in accordance with the JSF 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 null
protected  String getId(FaceletContext ctx)
          If the id TagAttribute was specified, get it's value, otherwise generate a unique id from our tagId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 JSF 1.2 spec.
  1. First determines this UIComponent's id by calling getId(FaceletContext).
  2. Search the parent for an existing UIComponent of the id we just grabbed
  3. If found, mark its children for deletion.
  4. If not found, call createComponent.
    1. Only here do we apply attributes
    2. Set the UIComponent's id
    3. Set the RendererType of this instance
  5. Now apply the nextHandler, passing the UIComponent we've created/found.
  6. Now add the UIComponent to the passed parent
  7. Lastly, if the UIComponent already existed (found), then finalize for deletion.

Specified by:
apply in class TagHandlerDelegate
Throws:
TagException - if the UIComponent parent is null
IOException
See Also:
FaceletHandler.apply(javax.faces.view.facelets.FaceletContext, javax.faces.component.UIComponent)

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.

Parameters:
ctx - FaceletContext to use in creating a component
Returns:
See Also:
Application.createComponent(javax.faces.el.ValueBinding, javax.faces.context.FacesContext, java.lang.String), Application.createComponent(java.lang.String)

getId

protected String getId(FaceletContext ctx)
If the id TagAttribute was specified, get it's value, otherwise generate a unique id from our tagId.

Parameters:
ctx - FaceletContext to use
Returns:
what should be a unique Id
See Also:
TagAttribute.getValue(FaceletContext)

createMetaRuleset

public MetaRuleset createMetaRuleset(Class type)
Specified by:
createMetaRuleset in class TagHandlerDelegate


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.