Interface Node
- All Superinterfaces:
Renderable
- All Known Implementing Classes:
ASTAddNode
,ASTAndNode
,ASTAssignment
,ASTBinaryOperator
,ASTBlock
,ASTComment
,ASTComparisonNode
,ASTDirective
,ASTDirectiveAssign
,ASTDivNode
,ASTElseIfStatement
,ASTElseStatement
,ASTEQNode
,ASTEscape
,ASTEscapedDirective
,ASTExpression
,ASTFalse
,ASTFloatingPointLiteral
,ASTGENode
,ASTGTNode
,ASTIdentifier
,ASTIfStatement
,ASTIncludeStatement
,ASTIndex
,ASTIntegerLiteral
,ASTIntegerRange
,ASTLENode
,ASTLogicalOperator
,ASTLTNode
,ASTMap
,ASTMathNode
,ASTMethod
,ASTModNode
,ASTMulNode
,ASTNegateNode
,ASTNENode
,ASTNotNode
,ASTObjectArray
,ASTOrNode
,ASTParameters
,ASTprocess
,ASTReference
,ASTSetDirective
,ASTStringLiteral
,ASTSubtractNode
,ASTText
,ASTTextblock
,ASTTrue
,ASTVariable
,ASTWord
,SimpleNode
This file describes the interface between the Velocity code
and the JavaCC generated code.
- Version:
- $Id$
- Author:
- Henning P. Schmiedehausen
-
Method Summary
Modifier and TypeMethodDescriptionchildrenAccept
(StandardParserVisitor visitor, Object data) boolean
evaluate
(InternalContextAdapter context) execute
(Object o, InternalContextAdapter context) int
int
getInfo()
int
getLine()
int
getType()
init
(InternalContextAdapter context, Object data) boolean
jjtAccept
(StandardParserVisitor visitor, Object data) void
jjtAddChild
(Node n, int i) This method tells the node to add its argument to the node's list of children.void
jjtClose()
This method is called after all the child nodes have been added.jjtGetChild
(int i) This method returns a child node.int
Return the number of children the node has.void
jjtOpen()
This method is called after the node has been made the current node.void
jjtSetParent
(Node n) This pair of methods are used to inform the node of its parent.literal()
boolean
render
(InternalContextAdapter context, Writer writer) void
setInfo
(int info) void
Mark the node as invalid.value
(InternalContextAdapter context)
-
Method Details
-
jjtOpen
void jjtOpen()This method is called after the node has been made the current node. It indicates that child nodes can now be added to it. -
jjtClose
void jjtClose()This method is called after all the child nodes have been added. -
jjtSetParent
This pair of methods are used to inform the node of its parent.- Parameters:
n
-
-
jjtGetParent
Node jjtGetParent()- Returns:
- The node parent.
-
jjtAddChild
This method tells the node to add its argument to the node's list of children.- Parameters:
n
-i
-
-
jjtGetChild
This method returns a child node. The children are numbered from zero, left to right.- Parameters:
i
-- Returns:
- A child node.
-
jjtGetNumChildren
int jjtGetNumChildren()Return the number of children the node has.- Returns:
- The number of children of this node.
-
jjtAccept
- Parameters:
visitor
-data
-- Returns:
- The Node execution result object.
-
childrenAccept
- Parameters:
visitor
-data
-- Returns:
- The node execution result.
- See Also:
-
getFirstToken
Token getFirstToken()- Returns:
- The first token.
-
getLastToken
Token getLastToken()- Returns:
- The last token.
-
getType
int getType()- Returns:
- The NodeType.
-
init
- Parameters:
context
-data
-- Returns:
- The init result.
- Throws:
TemplateInitException
-
evaluate
- Parameters:
context
-- Returns:
- The evaluation result.
- Throws:
MethodInvocationException
-
value
- Parameters:
context
-- Returns:
- The node value.
- Throws:
MethodInvocationException
-
render
boolean render(InternalContextAdapter context, Writer writer) throws IOException, MethodInvocationException, ParseErrorException, ResourceNotFoundException - Specified by:
render
in interfaceRenderable
- Parameters:
context
-writer
-- Returns:
- True if the node rendered successfully.
- Throws:
IOException
MethodInvocationException
ParseErrorException
ResourceNotFoundException
-
execute
- Parameters:
o
-context
-- Returns:
- The execution result.
- Throws:
MethodInvocationException
-
setInfo
void setInfo(int info) - Parameters:
info
-
-
getInfo
int getInfo()- Returns:
- The current node info.
-
literal
String literal()- Returns:
- A literal.
-
setInvalid
void setInvalid()Mark the node as invalid. -
isInvalid
boolean isInvalid()- Returns:
- True if the node is invalid.
-
getLine
int getLine()- Returns:
- The current line position.
-
getColumn
int getColumn()- Returns:
- The current column position.
-
getTemplateName
String getTemplateName()- Returns:
- the file name of the template
-
getFirstTokenImage
String getFirstTokenImage()- Returns:
- cached image (String) of the first Token for this Node returned by the Parser
-
getLastTokenImage
String getLastTokenImage()- Returns:
- cached image (String) of the last Token for this Node returned by the Parser
-
getTemplate
Template getTemplate()- Returns:
- the template this node belongs to
-
getParser
Parser getParser()- Returns:
- the parser which generated this node
- Since:
- 2.2
-