Class Node

java.lang.Object
org.apache.jasper.compiler.Node
All Implemented Interfaces:
TagConstants
Direct Known Subclasses:
Node.AttributeDirective, Node.AttributeGenerator, Node.Comment, Node.CustomTag, Node.DoBodyAction, Node.ELExpression, Node.FallBackAction, Node.ForwardAction, Node.GetProperty, Node.IncludeAction, Node.IncludeDirective, Node.InvokeAction, Node.JspBody, Node.JspElement, Node.JspOutput, Node.JspRoot, Node.JspText, Node.NamedAttribute, Node.PageDirective, Node.ParamAction, Node.ParamsAction, Node.PlugIn, Node.Root, Node.ScriptingElement, Node.SetProperty, Node.TagDirective, Node.TaglibDirective, Node.TemplateText, Node.UninterpretedTag, Node.UseBean, Node.VariableDirective

abstract class Node extends Object implements TagConstants
An internal data representation of a JSP page or a JSP docuement (XML). Also included here is a visitor class for tranversing nodes.
  • Field Details

    • ZERO_VARIABLE_INFO

      private static final javax.servlet.jsp.tagext.VariableInfo[] ZERO_VARIABLE_INFO
    • attrs

      protected Attributes attrs
    • taglibAttrs

      protected Attributes taglibAttrs
    • nonTaglibXmlnsAttrs

      protected Attributes nonTaglibXmlnsAttrs
    • body

      protected Node.Nodes body
    • text

      protected String text
    • startMark

      protected Mark startMark
    • beginJavaLine

      protected int beginJavaLine
    • endJavaLine

      protected int endJavaLine
    • parent

      protected Node parent
    • namedAttributeNodes

      protected Node.Nodes namedAttributeNodes
    • qName

      protected String qName
    • localName

      protected String localName
    • innerClassName

      protected String innerClassName
    • isDummy

      private boolean isDummy
  • Constructor Details

    • Node

      public Node()
      Zero-arg Constructor.
    • Node

      public Node(Mark start, Node parent)
      Constructor.
      Parameters:
      start - The location of the jsp page
      parent - The enclosing node
    • Node

      public Node(String qName, String localName, Mark start, Node parent)
      Constructor.
      Parameters:
      qName - The action's qualified name
      localName - The action's local name
      start - The location of the jsp page
      parent - The enclosing node
    • Node

      public Node(String qName, String localName, Attributes attrs, Mark start, Node parent)
      Constructor for Nodes parsed from standard syntax.
      Parameters:
      qName - The action's qualified name
      localName - The action's local name
      attrs - The attributes for this node
      start - The location of the jsp page
      parent - The enclosing node
    • Node

      public Node(String qName, String localName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)
      Constructor for Nodes parsed from XML syntax.
      Parameters:
      qName - The action's qualified name
      localName - The action's local name
      attrs - The action's attributes whose name does not start with xmlns
      nonTaglibXmlnsAttrs - The action's xmlns attributes that do not represent tag libraries
      taglibAttrs - The action's xmlns attributes that represent tag libraries
      start - The location of the jsp page
      parent - The enclosing node
    • Node

      public Node(String qName, String localName, String text, Mark start, Node parent)
  • Method Details

    • getQName

      public String getQName()
    • getLocalName

      public String getLocalName()
    • getAttributes

      public Attributes getAttributes()
    • getTaglibAttributes

      public Attributes getTaglibAttributes()
    • getNonTaglibXmlnsAttributes

      public Attributes getNonTaglibXmlnsAttributes()
    • setAttributes

      public void setAttributes(Attributes attrs)
    • getAttributeValue

      public String getAttributeValue(String name)
    • getTextAttribute

      public String getTextAttribute(String name)
      Get the attribute that is non request time expression, either from the attribute of the node, or from a jsp:attrbute
    • getNamedAttributeNode

      public Node.NamedAttribute getNamedAttributeNode(String name)
      Searches all subnodes of this node for jsp:attribute standard actions with the given name, and returns the NamedAttribute node of the matching named attribute, nor null if no such node is found.

      This should always be called and only be called for nodes that accept dynamic runtime attribute expressions.

    • getNamedAttributeNodes

      public Node.Nodes getNamedAttributeNodes()
      Searches all subnodes of this node for jsp:attribute standard actions, and returns that set of nodes as a Node.Nodes object.
      Returns:
      Possibly empty Node.Nodes object containing any jsp:attribute subnodes of this Node
    • getBody

      public Node.Nodes getBody()
    • setBody

      public void setBody(Node.Nodes body)
    • getText

      public String getText()
    • getStart

      public Mark getStart()
    • getParent

      public Node getParent()
    • getBeginJavaLine

      public int getBeginJavaLine()
    • setBeginJavaLine

      public void setBeginJavaLine(int begin)
    • getEndJavaLine

      public int getEndJavaLine()
    • setEndJavaLine

      public void setEndJavaLine(int end)
    • isDummy

      public boolean isDummy()
    • getRoot

      public Node.Root getRoot()
    • getInnerClassName

      public String getInnerClassName()
    • setInnerClassName

      public void setInnerClassName(String icn)
    • accept

      abstract void accept(Node.Visitor v) throws JasperException
      Selects and invokes a method in the visitor class based on the node type. This is abstract and should be overrode by the extending classes.
      Parameters:
      v - The visitor class
      Throws:
      JasperException
    • addToParent

      private void addToParent(Node parent)