Class Template

java.lang.Object
org.apache.xalan.xsltc.compiler.SyntaxTreeNode
org.apache.xalan.xsltc.compiler.Template
All Implemented Interfaces:
org.apache.bcel.generic.InstructionConstants, Constants

public final class Template extends SyntaxTreeNode
Author:
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen, Erwin Bolwidt invalid input: '<'ejb@klomp.org>
  • Constructor Details

    • Template

      public Template()
  • Method Details

    • hasParams

      public boolean hasParams()
    • isSimplified

      public boolean isSimplified()
    • setSimplified

      public void setSimplified()
    • isSimpleNamedTemplate

      public boolean isSimpleNamedTemplate()
    • addParameter

      public void addParameter(org.apache.xalan.xsltc.compiler.Param param)
    • getParameters

      public Vector getParameters()
    • disable

      public void disable()
    • disabled

      public boolean disabled()
    • getPriority

      public double getPriority()
    • getPosition

      public int getPosition()
    • isNamed

      public boolean isNamed()
    • getPattern

      public Pattern getPattern()
    • getName

      public org.apache.xalan.xsltc.compiler.QName getName()
    • setName

      public void setName(org.apache.xalan.xsltc.compiler.QName qname)
    • getModeName

      public org.apache.xalan.xsltc.compiler.QName getModeName()
    • compareTo

      public int compareTo(Object template)
      Compare this template to another. First checks priority, then position.
    • display

      public void display(int indent)
      Description copied from class: SyntaxTreeNode
      Displays the contents of this syntax tree node (to stdout). This method is intended for debugging _only_, and should be overridden by all syntax tree node implementations.
      Parameters:
      indent - Indentation level for syntax tree levels.
    • getStylesheet

      public Stylesheet getStylesheet()
      Description copied from class: SyntaxTreeNode
      Get the Stylesheet node that represents the invalid input: '<'xsl:stylesheet/> element that this node occured under.
      Overrides:
      getStylesheet in class SyntaxTreeNode
      Returns:
      The Stylesheet ancestor node of this node.
    • parseContents

      public void parseContents(Parser parser)
      Description copied from class: SyntaxTreeNode
      Parse the contents of this syntax tree nodes (child nodes, XPath expressions, patterns and functions). The default behaviour is to parser the syntax tree node's children (since there are no common expressions, patterns, etc. that can be handled in this base class.
      Overrides:
      parseContents in class SyntaxTreeNode
      Parameters:
      parser - reference to the XSLT parser
    • parseSimplified

      public void parseSimplified(Stylesheet stylesheet, Parser parser)
      When the parser realises that it is dealign with a simplified stylesheet it will create an empty Stylesheet object with the root element of the stylesheet (a LiteralElement object) as its only child. The Stylesheet object will then create this Template object and invoke this method to force some specific behaviour. What we need to do is: o) create a pattern matching on the root node o) add the LRE root node (the only child of the Stylesheet) as our only child node o) set the empty Stylesheet as our parent o) set this template as the Stylesheet's only child
    • typeCheck

      public Type typeCheck(org.apache.xalan.xsltc.compiler.SymbolTable stable) throws TypeCheckError
      Type check all the children of this node.
      Parameters:
      stable - The compiler/parser's symbol table
      Throws:
      TypeCheckError
    • translate

      public void translate(ClassGenerator classGen, MethodGenerator methodGen)
      Translate this node into JVM bytecodes.
      Parameters:
      classGen - BCEL Java class generator
      methodGen - BCEL Java method generator
    • compile

      public org.apache.bcel.generic.InstructionList compile(ClassGenerator classGen, MethodGenerator methodGen)
      Translate this node into a fresh instruction list. The original instruction list is saved and restored.
    • addDependency

      public void addDependency(org.apache.xalan.xsltc.compiler.TopLevelElement other)
      Add a dependency with other top-level elements like variables, parameters or keys.
    • getDependencies

      public Vector getDependencies()
      Get the list of dependencies with other top-level elements like variables, parameteres or keys.