Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sun.facelets.tag.jsf
Class ComponentHandler  view ComponentHandler download ComponentHandler.java

java.lang.Object
  extended bycom.sun.facelets.tag.TagHandler
      extended bycom.sun.facelets.tag.MetaTagHandler
          extended bycom.sun.facelets.tag.jsf.ComponentHandler
All Implemented Interfaces:
com.sun.facelets.FaceletHandler

public class ComponentHandler
extends com.sun.facelets.tag.MetaTagHandler

Implementation of the tag logic used in the JSF specification. This is your golden hammer for wiring UIComponents to Facelets.

Version:
$Id: ComponentHandler.java,v 1.14 2006/03/29 15:01:22 jhook Exp $

Field Summary
private  com.sun.facelets.tag.TagAttribute binding
           
private  java.lang.String componentType
           
private  com.sun.facelets.tag.TagAttribute id
           
private static java.util.logging.Logger log
           
private  java.lang.String rendererType
           
 
Fields inherited from class com.sun.facelets.tag.MetaTagHandler
 
Fields inherited from class com.sun.facelets.tag.TagHandler
nextHandler, tag, tagId
 
Constructor Summary
ComponentHandler(ComponentConfig config)
           
 
Method Summary
 void apply(com.sun.facelets.FaceletContext ctx, javax.faces.component.UIComponent parent)
          Method handles UIComponent tree creation in accordance with the JSF 1.2 spec.
protected  void applyNextHandler(com.sun.facelets.FaceletContext ctx, javax.faces.component.UIComponent c)
           
protected  javax.faces.component.UIComponent createComponent(com.sun.facelets.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.
protected  com.sun.facelets.tag.MetaRuleset createMetaRuleset(java.lang.Class type)
          Extend this method in order to add your own rules.
protected  java.lang.String getId(com.sun.facelets.FaceletContext ctx)
          If the id TagAttribute was specified, get it's value, otherwise generate a unique id from our tagId.
protected  void onComponentCreated(com.sun.facelets.FaceletContext ctx, javax.faces.component.UIComponent c, javax.faces.component.UIComponent parent)
          A hook method for allowing developers to do additional processing once Facelets creates the component.
protected  void onComponentPopulated(com.sun.facelets.FaceletContext ctx, javax.faces.component.UIComponent c, javax.faces.component.UIComponent parent)
           
 
Methods inherited from class com.sun.facelets.tag.MetaTagHandler
setAttributes
 
Methods inherited from class com.sun.facelets.tag.TagHandler
findNextByType, getAttribute, getRequiredAttribute, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static final java.util.logging.Logger log

binding

private final com.sun.facelets.tag.TagAttribute binding

componentType

private final java.lang.String componentType

id

private final com.sun.facelets.tag.TagAttribute id

rendererType

private final java.lang.String rendererType
Constructor Detail

ComponentHandler

public ComponentHandler(ComponentConfig config)
Method Detail

apply

public final void apply(com.sun.facelets.FaceletContext ctx,
                        javax.faces.component.UIComponent parent)
                 throws java.io.IOException,
                        javax.faces.FacesException,
                        ELException
Method handles UIComponent tree creation in accordance with the JSF 1.2 spec.
  1. First determines this UIComponent's id by calling getId(FaceletContext) 55 .
  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 55 .
    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.


createComponent

protected javax.faces.component.UIComponent createComponent(com.sun.facelets.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.


getId

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


createMetaRuleset

protected com.sun.facelets.tag.MetaRuleset createMetaRuleset(java.lang.Class type)
Description copied from class: com.sun.facelets.tag.MetaTagHandler
Extend this method in order to add your own rules.


onComponentCreated

protected void onComponentCreated(com.sun.facelets.FaceletContext ctx,
                                  javax.faces.component.UIComponent c,
                                  javax.faces.component.UIComponent parent)
A hook method for allowing developers to do additional processing once Facelets creates the component. The 'setAttributes' method is still perferred, but this method will provide the parent UIComponent before it's been added to the tree and before any children have been added to the newly created UIComponent.


onComponentPopulated

protected void onComponentPopulated(com.sun.facelets.FaceletContext ctx,
                                    javax.faces.component.UIComponent c,
                                    javax.faces.component.UIComponent parent)

applyNextHandler

protected void applyNextHandler(com.sun.facelets.FaceletContext ctx,
                                javax.faces.component.UIComponent c)
                         throws java.io.IOException,
                                javax.faces.FacesException,
                                ELException