org.apache.jasper.compiler
Class TagPoolGenerator

java.lang.Object
  |
  +--org.apache.jasper.compiler.GeneratorBase
        |
        +--org.apache.jasper.compiler.TagPoolGenerator
All Implemented Interfaces:
ClassDeclarationPhase, Generator, InitMethodPhase

public class TagPoolGenerator
extends org.apache.jasper.compiler.GeneratorBase
implements ClassDeclarationPhase, InitMethodPhase

This class generates tag pooling related information. Specifically, it generates code to declare tag pools and to obtain tag pools during jsp initialization.

Author:
Casey Lucas
See Also:
TagPoolManager

Field Summary
protected  JspCompilationContext ctxt
           
 
Constructor Summary
TagPoolGenerator(java.lang.String prefix, java.lang.String shortTagName, java.util.Hashtable attrs, javax.servlet.jsp.tagext.TagLibraryInfo tli, javax.servlet.jsp.tagext.TagInfo ti)
          Common constructor with enough information to generate code.
 
Method Summary
 void generate(ServletWriter writer, java.lang.Class phase)
          This method generates code from based on the jsp.
 boolean generateCoordinates(java.lang.Class phase)
           
static java.lang.String getPoolName(javax.servlet.jsp.tagext.TagLibraryInfo tli, javax.servlet.jsp.tagext.TagInfo ti, java.util.Hashtable attributes)
          This method returns a unique pool name based on the given TagLibraryInfo, TagInfo, and set of tag attributes.
static java.lang.String getPoolVariableName(java.lang.String poolName)
          This method returns a unique pool variable name given a unique pool name
static java.lang.String getPoolVariableName(javax.servlet.jsp.tagext.TagLibraryInfo tli, javax.servlet.jsp.tagext.TagInfo ti, java.util.Hashtable attributes)
          This method returns a unique pool variable name given TagLibraryInfo, TagInfo and set of tag attributes.
 void init(JspCompilationContext ctxt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ctxt

protected JspCompilationContext ctxt
Constructor Detail

TagPoolGenerator

public TagPoolGenerator(java.lang.String prefix,
                        java.lang.String shortTagName,
                        java.util.Hashtable attrs,
                        javax.servlet.jsp.tagext.TagLibraryInfo tli,
                        javax.servlet.jsp.tagext.TagInfo ti)
Common constructor with enough information to generate code.
Parameters:
prefix -  
shortTagName -  
attrs -  
tli -  
ti -  
Method Detail

getPoolName

public static java.lang.String getPoolName(javax.servlet.jsp.tagext.TagLibraryInfo tli,
                                           javax.servlet.jsp.tagext.TagInfo ti,
                                           java.util.Hashtable attributes)
This method returns a unique pool name based on the given TagLibraryInfo, TagInfo, and set of tag attributes. Tag attribute order does not affect the returned name.
Parameters:
tli -  
ti -  
attributes -  
Returns:
unique pool name based on parameters

getPoolVariableName

public static java.lang.String getPoolVariableName(javax.servlet.jsp.tagext.TagLibraryInfo tli,
                                                   javax.servlet.jsp.tagext.TagInfo ti,
                                                   java.util.Hashtable attributes)
This method returns a unique pool variable name given TagLibraryInfo, TagInfo and set of tag attributes.
Parameters:
tli -  
ti -  
attributes -  
Returns:
unique pool variable name based on parameters

getPoolVariableName

public static java.lang.String getPoolVariableName(java.lang.String poolName)
This method returns a unique pool variable name given a unique pool name
Parameters:
poolName -  
Returns:
unique pool variable name

generate

public void generate(ServletWriter writer,
                     java.lang.Class phase)
This method generates code from based on the jsp. During class declaration phase, it declares a tag pool for this tag. During the initilization phase, it generates code to lookup a pool from the tag pool manager.
Parameters:
writer -  
phase -  

init

public void init(JspCompilationContext ctxt)
          throws JasperException
Specified by:
init in interface Generator

generateCoordinates

public boolean generateCoordinates(java.lang.Class phase)
Specified by:
generateCoordinates in interface Generator


Copyright © 2001 Apache Software Foundation. All Rights Reserved.