com.sun.facelets.tag.jsf
Class ConvertHandler
java.lang.Object
com.sun.facelets.tag.TagHandler
com.sun.facelets.tag.MetaTagHandler
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
ConvertHandler
public ConvertHandler(TagConfig config)
- Deprecated.
- Parameters:
config
-
ConvertHandler
public ConvertHandler(ConverterConfig config)
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.
- Cast to ValueHolder
- If "binding" attribute was specified, fetch/create and re-bind to
expression.
- Otherwise, call
createConverter
.
- Call
setAttributes
on Converter instance.
- Set the Converter on the ValueHolder
- If the ValueHolder has a localValue, convert it and set the value
- Parameters:
ctx
- the current FaceletContext instance for this executionparent
- 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.