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

java.lang.Object
  extended by javax.faces.view.facelets.TagHandler
      extended by javax.faces.view.facelets.MetaTagHandler
          extended by org.apache.myfaces.view.facelets.tag.jsf.ComponentHandler
All Implemented Interfaces:
FaceletHandler

Deprecated. Use javax.faces.view.facelets.ComponentHandler instead

@Deprecated
public class ComponentHandler
extends 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 1187700 2011-10-22 12:19:37Z bommel $
Author:
Jacob Hookom

Field Summary
 
Fields inherited from class javax.faces.view.facelets.TagHandler
nextHandler, tag, tagId
 
Constructor Summary
ComponentHandler(ComponentConfig config)
          Deprecated.  
 
Method Summary
 void apply(FaceletContext ctx, UIComponent parent)
          Deprecated. Method handles UIComponent tree creation in accordance with the JSF 1.2 spec.
protected  void applyNextHandler(FaceletContext ctx, UIComponent c)
          Deprecated.  
protected  UIComponent createComponent(FaceletContext ctx)
          Deprecated. 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  MetaRuleset createMetaRuleset(Class type)
          Deprecated.  
protected  String getFacetName(FaceletContext ctx, UIComponent parent)
          Deprecated. Return the Facet name we are scoped in, otherwise null
protected  String getId(FaceletContext ctx)
          Deprecated. If the id TagAttribute was specified, get it's value, otherwise generate a unique id from our tagId.
protected  void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent)
          Deprecated. A hook method for allowing developers to do additional processing once Facelets creates the component.
protected  void onComponentPopulated(FaceletContext ctx, UIComponent c, UIComponent parent)
          Deprecated.  
 
Methods inherited from class javax.faces.view.facelets.MetaTagHandler
setAttributes
 
Methods inherited from class javax.faces.view.facelets.TagHandler
getAttribute, getRequiredAttribute, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComponentHandler

public ComponentHandler(ComponentConfig config)
Deprecated. 
Method Detail

apply

public final void apply(FaceletContext ctx,
                        UIComponent parent)
                 throws IOException,
                        FacesException,
                        javax.el.ELException
Deprecated. 
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.

Throws:
TagException - if the UIComponent parent is null
IOException
FacesException
javax.el.ELException
See Also:
FaceletHandler.apply(javax.faces.view.facelets.FaceletContext, javax.faces.component.UIComponent)

getFacetName

protected final String getFacetName(FaceletContext ctx,
                                    UIComponent parent)
Deprecated. 
Return the Facet name we are scoped in, otherwise null

Parameters:
ctx -
Returns:

createComponent

protected UIComponent createComponent(FaceletContext ctx)
Deprecated. 
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)
Deprecated. 
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

protected MetaRuleset createMetaRuleset(Class type)
Deprecated. 
Specified by:
createMetaRuleset in class MetaTagHandler

onComponentCreated

protected void onComponentCreated(FaceletContext ctx,
                                  UIComponent c,
                                  UIComponent parent)
Deprecated. 
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.

Parameters:
ctx -
c -
parent -

onComponentPopulated

protected void onComponentPopulated(FaceletContext ctx,
                                    UIComponent c,
                                    UIComponent parent)
Deprecated. 

applyNextHandler

protected void applyNextHandler(FaceletContext ctx,
                                UIComponent c)
                         throws IOException,
                                FacesException,
                                javax.el.ELException
Deprecated. 
Throws:
IOException
FacesException
javax.el.ELException


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