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

Quick Search    Search Deep

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

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

public class ConvertHandler
extends com.sun.facelets.tag.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 $

Field Summary
private  com.sun.facelets.tag.TagAttribute binding
           
private  java.lang.String converterId
           
 
Fields inherited from class com.sun.facelets.tag.MetaTagHandler
 
Fields inherited from class com.sun.facelets.tag.TagHandler
nextHandler, tag, tagId
 
Constructor Summary
ConvertHandler(ConverterConfig config)
           
ConvertHandler(com.sun.facelets.tag.TagConfig config)
          Deprecated.  
 
Method Summary
 void apply(com.sun.facelets.FaceletContext ctx, javax.faces.component.UIComponent parent)
          Set Converter instance on parent ValueHolder if it's not being restored.
protected  javax.faces.convert.Converter createConverter(com.sun.facelets.FaceletContext ctx)
          Create a Converter instance
protected  com.sun.facelets.tag.MetaRuleset createMetaRuleset(java.lang.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
 

Field Detail

binding

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

converterId

private java.lang.String converterId
Constructor Detail

ConvertHandler

public ConvertHandler(com.sun.facelets.tag.TagConfig config)
Deprecated.  


ConvertHandler

public ConvertHandler(ConverterConfig 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,
                        com.sun.facelets.FaceletException,
                        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 55 .
  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


createConverter

protected javax.faces.convert.Converter createConverter(com.sun.facelets.FaceletContext ctx)
Create a Converter instance


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.