com.caucho.jsp.java
Class JavaTagGenerator

java.lang.Object
  extended by com.caucho.jsp.JspGenerator
      extended by com.caucho.jsp.java.JavaJspGenerator
          extended by com.caucho.jsp.java.JavaTagGenerator

public class JavaTagGenerator
extends JavaJspGenerator

Generates JSP code. JavaGenerator, JavaScriptGenerator, and StaticGenerator specialize the JspGenerator for language-specific requirements.

JspParser parses the JSP file into an XML-DOM tree. JspGenerator generates code from that tree.


Field Summary
 
Fields inherited from class com.caucho.jsp.java.JavaJspGenerator
_cacheDepends, _className, _config, _declarations, _depends, _fullClassName, _ideHack, _isCacheable, _isUncacheable, _parseState, _pkg, _rootNode, _strings, _tagId, _tagManager, _topTag
 
Fields inherited from class com.caucho.jsp.JspGenerator
_jspBuilder, _jspCompiler, _jspCompilerInstance, _jspParser, _lineMap
 
Constructor Summary
JavaTagGenerator(ParseTagManager tagManager)
           
 
Method Summary
 void addAttribute(TldAttribute attribute)
          Adds an attribute.
 void addVariable(TldVariable var)
          Adds a variable.
 TldAttribute findAttribute(java.lang.String name)
          Finds an attribute.
 TldVariable findNameFromAttributeVariable(java.lang.String name)
          Finds a variable.
 TldVariable findVariable(java.lang.String name)
          Finds a variable.
protected  void generate(JspJavaWriter out)
          Generates the Java code.
protected  void generateAttributes(JspJavaWriter out)
          Generates the attribute definitions.
protected  void generateClassHeader(JspJavaWriter out)
          Generates the class header.
protected  void generateDoTag(JspJavaWriter out, JspNode node)
          Prints the _jspService header
protected  void generateDoTagImpl(JspJavaWriter out, JspNode node)
          Prints the _jspService header
protected  void generateDynamicAttributes(JspJavaWriter out)
          Generates the attribute definitions.
protected  void generatePrologue(JspJavaWriter out)
          Generates prologue stuff
protected  void generateTagAttributes(JspJavaWriter out)
          Generates the attribute definitions.
protected  void generateTagInfo(JspJavaWriter out)
          Generates the attribute definitions.
 TagInfo generateTagInfo(java.lang.String className, TagLibraryInfo taglib)
          Returns the tags taginfo.
protected  void generateTagLibrary(JspJavaWriter out)
          Generates the attribute definitions.
protected  void generateTagVariablesAtEnd(JspJavaWriter out)
          Generates the variable setting.
 java.util.ArrayList<TldAttribute> getAttributes()
          Returns the attributes.
 java.lang.String getBodyContent()
          Gets the body content.
 java.lang.String getDescription()
           
 java.lang.String getDisplayName()
           
 java.lang.String getDynamicAttributes()
          Gets the body content.
 java.lang.String getExample()
           
 java.lang.String getLargeIcon()
           
 java.lang.String getSmallIcon()
           
 java.util.ArrayList<TldVariable> getVariables()
          Returns the variables.
 void init()
           
protected  boolean isStaticDoTag()
           
 boolean isTag()
           
 void setBodyContent(java.lang.String bodyContent)
          Sets the body content.
 void setDescription(java.lang.String description)
          Returns true if the XML declaration should be ignored.
 void setDisplayName(java.lang.String displayName)
           
 void setDynamicAttributes(java.lang.String dynamicAttributes)
          Sets the name of the dynamic attributes map
 void setExample(java.lang.String example)
           
 void setLargeIcon(java.lang.String largeIcon)
           
 void setSmallIcon(java.lang.String smallIcon)
           
 
Methods inherited from class com.caucho.jsp.java.JavaJspGenerator
addBeanClass, addDeclaration, addDeclared, addDepend, addDepend, addDepend, addExpr, addFragment, addImport, addMethodExpr, addOptionalTaglib, addString, addTaglib, addTaglib, addTaglib, addTaglibDir, addValueExpr, addXPathExpr, addXPathExpr, error, error, fillSingleTaglibImports, generate, generateClassFooter, generateJspId, generatePageFooter, generatePageHeader, generateStatic, genExpr, getBeanClass, getClass, getConfig, getDependList, getELContext, getFragment, getPageData, getParseState, getRecycleTags, getRootTag, getSourceLines, getTag, getTagClass, getTagManager, hasScripting, init, isDeclared, isJsfPrologueInit, isPre21, isPrototype, isStatic, isStaticEncoding, setJsfPrologueInit, setPageConfig, setParseState, setRootNode, setTagManager, uniqueId, validate
 
Methods inherited from class com.caucho.jsp.JspGenerator
getJspBuilder, getJspCompiler, getJspCompilerInstance, getJspParser, getLineMap, isELIgnore, isTagDependent, setJspBuilder, setJspCompiler, setJspCompilerInstance, setJspParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaTagGenerator

public JavaTagGenerator(ParseTagManager tagManager)
Method Detail

init

public void init()
Overrides:
init in class JavaJspGenerator

setDescription

public void setDescription(java.lang.String description)
Returns true if the XML declaration should be ignored.


getDescription

public java.lang.String getDescription()

setDisplayName

public void setDisplayName(java.lang.String displayName)

getDisplayName

public java.lang.String getDisplayName()

setSmallIcon

public void setSmallIcon(java.lang.String smallIcon)

getSmallIcon

public java.lang.String getSmallIcon()

setLargeIcon

public void setLargeIcon(java.lang.String largeIcon)

getLargeIcon

public java.lang.String getLargeIcon()

setExample

public void setExample(java.lang.String example)

getExample

public java.lang.String getExample()

setBodyContent

public void setBodyContent(java.lang.String bodyContent)
Sets the body content.


getBodyContent

public java.lang.String getBodyContent()
Gets the body content.


setDynamicAttributes

public void setDynamicAttributes(java.lang.String dynamicAttributes)
Sets the name of the dynamic attributes map


getDynamicAttributes

public java.lang.String getDynamicAttributes()
Gets the body content.


addAttribute

public void addAttribute(TldAttribute attribute)
Adds an attribute.


getAttributes

public java.util.ArrayList<TldAttribute> getAttributes()
Returns the attributes.


findAttribute

public TldAttribute findAttribute(java.lang.String name)
Finds an attribute.


addVariable

public void addVariable(TldVariable var)
Adds a variable.


findVariable

public TldVariable findVariable(java.lang.String name)
Finds a variable.


findNameFromAttributeVariable

public TldVariable findNameFromAttributeVariable(java.lang.String name)
Finds a variable.


getVariables

public java.util.ArrayList<TldVariable> getVariables()
Returns the variables.


isTag

public boolean isTag()
Overrides:
isTag in class JavaJspGenerator

generate

protected void generate(JspJavaWriter out)
                 throws java.lang.Exception
Generates the Java code.

Overrides:
generate in class JavaJspGenerator
Throws:
java.lang.Exception

isStaticDoTag

protected boolean isStaticDoTag()

generateClassHeader

protected void generateClassHeader(JspJavaWriter out)
                            throws java.io.IOException,
                                   JspParseException
Generates the class header.

Overrides:
generateClassHeader in class JavaJspGenerator
Parameters:
doc - the XML document representing the JSP page.
Throws:
java.io.IOException
JspParseException

generateAttributes

protected void generateAttributes(JspJavaWriter out)
                           throws java.io.IOException,
                                  JspParseException
Generates the attribute definitions.

Parameters:
out - the writer to the .java source
Throws:
java.io.IOException
JspParseException

generateDynamicAttributes

protected void generateDynamicAttributes(JspJavaWriter out)
                                  throws java.io.IOException,
                                         JspParseException
Generates the attribute definitions.

Parameters:
out - the writer to the .java source
Throws:
java.io.IOException
JspParseException

generateDoTag

protected void generateDoTag(JspJavaWriter out,
                             JspNode node)
                      throws java.lang.Exception
Prints the _jspService header

Throws:
java.lang.Exception

generateTagAttributes

protected void generateTagAttributes(JspJavaWriter out)
                              throws java.io.IOException,
                                     JspParseException
Generates the attribute definitions.

Parameters:
out - the writer to the .java source
Throws:
java.io.IOException
JspParseException

generateDoTagImpl

protected void generateDoTagImpl(JspJavaWriter out,
                                 JspNode node)
                          throws java.lang.Exception
Prints the _jspService header

Throws:
java.lang.Exception

generatePrologue

protected void generatePrologue(JspJavaWriter out)
                         throws java.lang.Exception
Generates prologue stuff

Parameters:
out - the writer to the .java source
Throws:
java.lang.Exception

generateTagVariablesAtEnd

protected void generateTagVariablesAtEnd(JspJavaWriter out)
                                  throws java.io.IOException,
                                         JspParseException
Generates the variable setting.

Parameters:
out - the writer to the .java source
Throws:
java.io.IOException
JspParseException

generateTagInfo

public TagInfo generateTagInfo(java.lang.String className,
                               TagLibraryInfo taglib)
Description copied from class: JspGenerator
Returns the tags taginfo.

Overrides:
generateTagInfo in class JspGenerator

generateTagInfo

protected void generateTagInfo(JspJavaWriter out)
                        throws java.io.IOException,
                               JspParseException
Generates the attribute definitions.

Parameters:
out - the writer to the .java source
Throws:
java.io.IOException
JspParseException

generateTagLibrary

protected void generateTagLibrary(JspJavaWriter out)
                           throws java.io.IOException,
                                  JspParseException
Generates the attribute definitions.

Parameters:
out - the writer to the .java source
Throws:
java.io.IOException
JspParseException