com.sun.facelets.tag.jsf
Class ConvertHandler

java.lang.Object
  extended by com.sun.facelets.tag.TagHandler
      extended by com.sun.facelets.tag.MetaTagHandler
          extended by com.sun.facelets.tag.jsf.ConvertHandler
All Implemented Interfaces:
FaceletHandler
Direct Known Subclasses:
ConvertDateTimeHandler, ConvertDelegateHandler, ConvertNumberHandler

public class ConvertHandler
extends MetaTagHandler

Handles setting a Converter instance on a ValueHolder. Will wire all attributes set to the Converter instance created/fetched. Uses the "binding" attribute for grabbing instances to apply attributes to.

Will only set/create Converter is the passed UIComponent's parent is null, signifying that it wasn't restored from an existing tree.

Version:
$Id: ConvertHandler.java,v 1.3 2005/08/24 04:38:51 jhook Exp $
Author:
Jacob Hookom
See Also:
ConverterELTag, Converter, ValueHolder

Field Summary
 
Fields inherited from class com.sun.facelets.tag.TagHandler
nextHandler, tag, tagId
 
Constructor Summary
ConvertHandler(ConverterConfig config)
           
ConvertHandler(TagConfig config)
          Deprecated.  
 
Method Summary
 void apply(FaceletContext ctx, UIComponent parent)
          Set Converter instance on parent ValueHolder if it's not being restored.
protected  Converter createConverter(FaceletContext ctx)
          Create a Converter instance
protected  MetaRuleset createMetaRuleset(Class type)
          Extend this method in order to add your own rules.
 
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
 

Constructor Detail

ConvertHandler

public ConvertHandler(TagConfig config)
Deprecated. 

Parameters:
config -

ConvertHandler

public ConvertHandler(ConverterConfig config)
Method Detail

apply

public final void apply(FaceletContext ctx,
                        UIComponent parent)
                 throws IOException,
                        FacesException,
                        FaceletException,
                        javax.el.ELException
Set Converter instance on parent ValueHolder if it's not being restored.
  1. Cast to ValueHolder
  2. If "binding" attribute was specified, fetch/create and re-bind to expression.
  3. Otherwise, call createConverter.
  4. Call setAttributes on Converter instance.
  5. Set the Converter on the ValueHolder
  6. If the ValueHolder has a localValue, convert it and set the value

Parameters:
ctx - the current FaceletContext instance for this execution
parent - the parent UIComponent to operate upon
Throws:
IOException
FacesException
FaceletException
javax.el.ELException
See Also:
ValueHolder, Converter, createConverter(FaceletContext), FaceletHandler.apply(com.sun.facelets.FaceletContext, javax.faces.component.UIComponent)

createConverter

protected Converter createConverter(FaceletContext ctx)
Create a Converter instance

Parameters:
ctx - FaceletContext to use
Returns:
Converter instance, cannot be null

createMetaRuleset

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

Overrides:
createMetaRuleset in class MetaTagHandler
Returns:


Copyright © 2005 All Rights Reserved.