Package org.apache.jasper.compiler
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
An internal data representation of a JSP page or a JSP docuement (XML).
Also included here is a visitor class for tranversing nodes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Represents an attribute directivestatic class
Used as a placeholder for the evaluation code of a custom action attribute (used by the tag plugin machinery only).static class
Collected information about child elements.static class
Represents a Jsp comment Comments are kept for completeness.static class
Represents a custom tagstatic class
Represents a declarationstatic class
Represents a invalid input: '<'jsp:doBody> tag file actionstatic class
Represents an EL expression.static class
Represents an expression.static class
Represents a fallback actionstatic class
Represents a forward actionstatic class
Represents a getProperty actionstatic class
Represents an include actionstatic class
Represents an include directivestatic class
Represents a invalid input: '<'jsp:invoke> tag file actionstatic class
Represents attributes that can be request time expressions.static class
Represents a JspBody node (<jsp:body>)static class
Represents a invalid input: '<'jsp:element>.static class
Represents a invalid input: '<'jsp:output>.static class
Represents the root of a Jsp document (XML syntax)static class
Represents the body of a <jsp:text> elementstatic class
Represents a Named Attribute (<jsp:attribute>)static class
An ordered list of Node, used to represent the body of an element, or a jsp page of jsp document.static class
Represents a page directivestatic class
Represents a param actionstatic class
Represents a params actionstatic class
Represents a plugin actionstatic class
Represents the root of a Jsp page or Jsp documentstatic class
Represents an expression, declaration, or scriptletstatic class
Represents a scriptletstatic class
Represents a setProperty actionstatic class
Represents a tag directivestatic class
Represents a custom taglib directivestatic class
Represents a template text stringstatic class
Represents an uninterpreted tag, from a Jsp documentstatic class
Represents a useBean actionstatic class
Represents a variable directivestatic class
A visitor class for visiting the node. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Attributes
protected int
protected Node.Nodes
protected int
protected String
private boolean
protected String
protected Node.Nodes
protected Attributes
protected Node
protected String
protected Mark
protected Attributes
protected String
private static final javax.servlet.jsp.tagext.VariableInfo[]
Fields inherited from interface org.apache.jasper.compiler.TagConstants
ATTRIBUTE_ACTION, ATTRIBUTE_DIRECTIVE_ACTION, BODY_ACTION, DECLARATION_ACTION, DIRECTIVE_ACTION, DOBODY_ACTION, ELEMENT_ACTION, EXPRESSION_ACTION, FALLBACK_ACTION, FORWARD_ACTION, GET_PROPERTY_ACTION, INCLUDE_ACTION, INCLUDE_DIRECTIVE_ACTION, INVOKE_ACTION, JSP_ATTRIBUTE_ACTION, JSP_ATTRIBUTE_DIRECTIVE_ACTION, JSP_BODY_ACTION, JSP_DECLARATION_ACTION, JSP_DOBODY_ACTION, JSP_ELEMENT_ACTION, JSP_EXPRESSION_ACTION, JSP_FALLBACK_ACTION, JSP_FORWARD_ACTION, JSP_GET_PROPERTY_ACTION, JSP_INCLUDE_ACTION, JSP_INCLUDE_DIRECTIVE_ACTION, JSP_INVOKE_ACTION, JSP_OUTPUT_ACTION, JSP_PAGE_DIRECTIVE_ACTION, JSP_PARAM_ACTION, JSP_PARAMS_ACTION, JSP_PLUGIN_ACTION, JSP_ROOT_ACTION, JSP_SCRIPTLET_ACTION, JSP_SET_PROPERTY_ACTION, JSP_TAG_DIRECTIVE_ACTION, JSP_TAGLIB_DIRECTIVE_ACTION, JSP_TEXT_ACTION, JSP_TEXT_ACTION_END, JSP_URI, JSP_USE_BEAN_ACTION, JSP_VARIABLE_DIRECTIVE_ACTION, OUTPUT_ACTION, PAGE_DIRECTIVE_ACTION, PARAM_ACTION, PARAMS_ACTION, PLUGIN_ACTION, ROOT_ACTION, SCRIPTLET_ACTION, SET_PROPERTY_ACTION, TAG_DIRECTIVE_ACTION, TAGLIB_DIRECTIVE_ACTION, TEXT_ACTION, URN_JSPTAGDIR, URN_JSPTLD, USE_BEAN_ACTION, VARIABLE_DIRECTIVE_ACTION
-
Constructor Summary
ConstructorsConstructorDescriptionNode()
Zero-arg Constructor.Constructor.Constructor for Nodes parsed from standard syntax.Node
(String qName, String localName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent) Constructor for Nodes parsed from XML syntax.Constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) abstract void
Selects and invokes a method in the visitor class based on the node type.private void
addToParent
(Node parent) getAttributeValue
(String name) int
getBody()
int
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.Searches all subnodes of this node for jsp:attribute standard actions, and returns that set of nodes as a Node.Nodes object.getQName()
getRoot()
getStart()
getText()
getTextAttribute
(String name) Get the attribute that is non request time expression, either from the attribute of the node, or from a jsp:attrbuteboolean
isDummy()
void
setAttributes
(Attributes attrs) void
setBeginJavaLine
(int begin) void
setBody
(Node.Nodes body) void
setEndJavaLine
(int end) void
setInnerClassName
(String icn)
-
Field Details
-
ZERO_VARIABLE_INFO
private static final javax.servlet.jsp.tagext.VariableInfo[] ZERO_VARIABLE_INFO -
attrs
-
taglibAttrs
-
nonTaglibXmlnsAttrs
-
body
-
text
-
startMark
-
beginJavaLine
protected int beginJavaLine -
endJavaLine
protected int endJavaLine -
parent
-
namedAttributeNodes
-
qName
-
localName
-
innerClassName
-
isDummy
private boolean isDummy
-
-
Constructor Details
-
Node
public Node()Zero-arg Constructor. -
Node
Constructor.- Parameters:
start
- The location of the jsp pageparent
- The enclosing node
-
Node
Constructor.- Parameters:
qName
- The action's qualified namelocalName
- The action's local namestart
- The location of the jsp pageparent
- The enclosing node
-
Node
Constructor for Nodes parsed from standard syntax.- Parameters:
qName
- The action's qualified namelocalName
- The action's local nameattrs
- The attributes for this nodestart
- The location of the jsp pageparent
- 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 namelocalName
- The action's local nameattrs
- The action's attributes whose name does not start with xmlnsnonTaglibXmlnsAttrs
- The action's xmlns attributes that do not represent tag librariestaglibAttrs
- The action's xmlns attributes that represent tag librariesstart
- The location of the jsp pageparent
- The enclosing node
-
Node
-
-
Method Details
-
getQName
-
getLocalName
-
getAttributes
-
getTaglibAttributes
-
getNonTaglibXmlnsAttributes
-
setAttributes
-
getAttributeValue
-
getTextAttribute
Get the attribute that is non request time expression, either from the attribute of the node, or from a jsp:attrbute -
getNamedAttributeNode
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
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
-
setBody
-
getText
-
getStart
-
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
-
getInnerClassName
-
setInnerClassName
-
accept
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
-