org.apache.myfaces.view.facelets.tag.jsf
Class ConverterTagHandlerDelegate
java.lang.Object
javax.faces.view.facelets.TagHandlerDelegate
org.apache.myfaces.view.facelets.tag.jsf.ConverterTagHandlerDelegate
- All Implemented Interfaces:
- javax.faces.view.AttachedObjectHandler, javax.faces.view.ValueHolderAttachedObjectHandler
public class ConverterTagHandlerDelegate
- extends javax.faces.view.facelets.TagHandlerDelegate
- implements javax.faces.view.ValueHolderAttachedObjectHandler
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.
- Since:
- 2.0
- Version:
- $Revision: 964310 $ $Date: 2010-07-15 01:17:19 -0500 (Thu, 15 Jul 2010) $
- Author:
- Leonardo Uribe (latest modification by $Author: lu4242 $)
Method Summary |
void |
apply(javax.faces.view.facelets.FaceletContext ctx,
javax.faces.component.UIComponent parent)
Set Converter instance on parent ValueHolder if it's not being restored. |
void |
applyAttachedObject(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent parent)
|
protected javax.faces.convert.Converter |
createConverter(javax.faces.view.facelets.FaceletContext ctx)
Create a Converter instance |
javax.faces.view.facelets.MetaRuleset |
createMetaRuleset(java.lang.Class type)
|
java.lang.String |
getFor()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConverterTagHandlerDelegate
public ConverterTagHandlerDelegate(javax.faces.view.facelets.ConverterHandler delegate)
apply
public void apply(javax.faces.view.facelets.FaceletContext ctx,
javax.faces.component.UIComponent parent)
throws java.io.IOException
- 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
- Specified by:
apply
in class javax.faces.view.facelets.TagHandlerDelegate
- Throws:
java.io.IOException
- See Also:
ValueHolder
,
Converter
,
createConverter(FaceletContext)
,
FaceletHandler.apply(javax.faces.view.facelets.FaceletContext, javax.faces.component.UIComponent)
createConverter
protected javax.faces.convert.Converter createConverter(javax.faces.view.facelets.FaceletContext ctx)
- Create a Converter instance
- Parameters:
ctx
- FaceletContext to use
- Returns:
- Converter instance, cannot be null
createMetaRuleset
public javax.faces.view.facelets.MetaRuleset createMetaRuleset(java.lang.Class type)
- Specified by:
createMetaRuleset
in class javax.faces.view.facelets.TagHandlerDelegate
applyAttachedObject
public void applyAttachedObject(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent parent)
- Specified by:
applyAttachedObject
in interface javax.faces.view.AttachedObjectHandler
getFor
public java.lang.String getFor()
- Specified by:
getFor
in interface javax.faces.view.AttachedObjectHandler
Copyright © 2011 The Apache Software Foundation. All Rights Reserved.