Class SimpleNode
java.lang.Object
org.apache.velocity.runtime.parser.node.SimpleNode
- All Implemented Interfaces:
Node
,Renderable
- Direct Known Subclasses:
ASTAndNode
,ASTAssignment
,ASTBlock
,ASTComment
,ASTDirective
,ASTElseIfStatement
,ASTElseStatement
,ASTEQNode
,ASTEscape
,ASTEscapedDirective
,ASTExpression
,ASTFalse
,ASTFloatingPointLiteral
,ASTGENode
,ASTGTNode
,ASTIdentifier
,ASTIfStatement
,ASTIncludeStatement
,ASTIndex
,ASTIntegerLiteral
,ASTIntegerRange
,ASTLENode
,ASTLTNode
,ASTMap
,ASTMathNode
,ASTMethod
,ASTNENode
,ASTNotNode
,ASTObjectArray
,ASTOrNode
,ASTParameters
,ASTprocess
,ASTReference
,ASTSetDirective
,ASTStringLiteral
,ASTText
,ASTTextblock
,ASTTrue
,ASTVariable
,ASTWord
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchildrenAccept
(ParserVisitor visitor, Object data) void
Override this method if you want to customize how the node dumps out its children.boolean
evaluate
(InternalContextAdapter context) execute
(Object o, InternalContextAdapter context) int
int
getInfo()
int
getLine()
protected String
getLocation
(InternalContextAdapter context) Return a string that tells the current location of this node.int
getType()
init
(InternalContextAdapter context, Object data) boolean
jjtAccept
(ParserVisitor 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
void
setInfo
(int info) void
Mark the node as invalid.toString()
value
(InternalContextAdapter context)
-
Field Details
-
rsvc
-
log
-
parent
-
children
-
id
protected int id -
parser
-
info
protected int info -
state
public boolean state -
invalid
protected boolean invalid -
first
-
last
-
templateName
-
-
Constructor Details
-
SimpleNode
public SimpleNode(int i) - Parameters:
i
-
-
SimpleNode
- Parameters:
p
-i
-
-
-
Method Details
-
getRuntimeServices
-
jjtOpen
public void jjtOpen()Description copied from interface:Node
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
public void jjtClose()Description copied from interface:Node
This method is called after all the child nodes have been added. -
setFirstToken
- Parameters:
t
-
-
getFirstToken
- Specified by:
getFirstToken
in interfaceNode
- Returns:
- The first token.
- See Also:
-
getLastToken
- Specified by:
getLastToken
in interfaceNode
- Returns:
- The last token.
- See Also:
-
jjtSetParent
Description copied from interface:Node
This pair of methods are used to inform the node of its parent.- Specified by:
jjtSetParent
in interfaceNode
- See Also:
-
jjtGetParent
- Specified by:
jjtGetParent
in interfaceNode
- Returns:
- The node parent.
- See Also:
-
jjtAddChild
Description copied from interface:Node
This method tells the node to add its argument to the node's list of children.- Specified by:
jjtAddChild
in interfaceNode
- See Also:
-
jjtGetChild
Description copied from interface:Node
This method returns a child node. The children are numbered from zero, left to right.- Specified by:
jjtGetChild
in interfaceNode
- Returns:
- A child node.
- See Also:
-
jjtGetNumChildren
public int jjtGetNumChildren()Description copied from interface:Node
Return the number of children the node has.- Specified by:
jjtGetNumChildren
in interfaceNode
- Returns:
- The number of children of this node.
- See Also:
-
jjtAccept
-
childrenAccept
- Specified by:
childrenAccept
in interfaceNode
- Returns:
- The node execution result.
- See Also:
-
toString
- Parameters:
prefix
-- Returns:
- String representation of this node.
-
dump
Override this method if you want to customize how the node dumps out its children.- Parameters:
prefix
-
-
getLocation
Return a string that tells the current location of this node. -
literal
-
init
- Specified by:
init
in interfaceNode
- Returns:
- The init result.
- Throws:
TemplateInitException
- See Also:
-
evaluate
- Specified by:
evaluate
in interfaceNode
- Returns:
- The evaluation result.
- Throws:
MethodInvocationException
- See Also:
-
value
- Specified by:
value
in interfaceNode
- Returns:
- The node value.
- Throws:
MethodInvocationException
- See Also:
-
render
public boolean render(InternalContextAdapter context, Writer writer) throws IOException, MethodInvocationException, ParseErrorException, ResourceNotFoundException - Specified by:
render
in interfaceNode
- Specified by:
render
in interfaceRenderable
- Returns:
- True if the node rendered successfully.
- Throws:
IOException
MethodInvocationException
ParseErrorException
ResourceNotFoundException
- See Also:
-
execute
- Specified by:
execute
in interfaceNode
- Returns:
- The execution result.
- Throws:
MethodInvocationException
- See Also:
-
getType
public int getType() -
setInfo
public void setInfo(int info) -
getInfo
public int getInfo() -
setInvalid
public void setInvalid()Description copied from interface:Node
Mark the node as invalid.- Specified by:
setInvalid
in interfaceNode
- See Also:
-
isInvalid
public boolean isInvalid() -
getLine
public int getLine() -
getColumn
public int getColumn() -
toString
-
getTemplateName
- Specified by:
getTemplateName
in interfaceNode
- Returns:
- the file name of the template
-