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) voidOverride this method if you want to customize how the node dumps out its children.booleanevaluate(InternalContextAdapter context) execute(Object o, InternalContextAdapter context) intintgetInfo()intgetLine()protected StringgetLocation(InternalContextAdapter context) Return a string that tells the current location of this node.intgetType()init(InternalContextAdapter context, Object data) booleanjjtAccept(ParserVisitor visitor, Object data) voidjjtAddChild(Node n, int i) This method tells the node to add its argument to the node's list of children.voidjjtClose()This method is called after all the child nodes have been added.jjtGetChild(int i) This method returns a child node.intReturn the number of children the node has.voidjjtOpen()This method is called after the node has been made the current node.voidjjtSetParent(Node n) This pair of methods are used to inform the node of its parent.literal()booleanrender(InternalContextAdapter context, Writer writer) voidvoidsetInfo(int info) voidMark 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:NodeThis 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:NodeThis method is called after all the child nodes have been added. -
setFirstToken
- Parameters:
t-
-
getFirstToken
- Specified by:
getFirstTokenin interfaceNode- Returns:
- The first token.
- See Also:
-
getLastToken
- Specified by:
getLastTokenin interfaceNode- Returns:
- The last token.
- See Also:
-
jjtSetParent
Description copied from interface:NodeThis pair of methods are used to inform the node of its parent.- Specified by:
jjtSetParentin interfaceNode- See Also:
-
jjtGetParent
- Specified by:
jjtGetParentin interfaceNode- Returns:
- The node parent.
- See Also:
-
jjtAddChild
Description copied from interface:NodeThis method tells the node to add its argument to the node's list of children.- Specified by:
jjtAddChildin interfaceNode- See Also:
-
jjtGetChild
Description copied from interface:NodeThis method returns a child node. The children are numbered from zero, left to right.- Specified by:
jjtGetChildin interfaceNode- Returns:
- A child node.
- See Also:
-
jjtGetNumChildren
public int jjtGetNumChildren()Description copied from interface:NodeReturn the number of children the node has.- Specified by:
jjtGetNumChildrenin interfaceNode- Returns:
- The number of children of this node.
- See Also:
-
jjtAccept
-
childrenAccept
- Specified by:
childrenAcceptin 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:
initin interfaceNode- Returns:
- The init result.
- Throws:
TemplateInitException- See Also:
-
evaluate
- Specified by:
evaluatein interfaceNode- Returns:
- The evaluation result.
- Throws:
MethodInvocationException- See Also:
-
value
- Specified by:
valuein interfaceNode- Returns:
- The node value.
- Throws:
MethodInvocationException- See Also:
-
render
public boolean render(InternalContextAdapter context, Writer writer) throws IOException, MethodInvocationException, ParseErrorException, ResourceNotFoundException - Specified by:
renderin interfaceNode- Specified by:
renderin interfaceRenderable- Returns:
- True if the node rendered successfully.
- Throws:
IOExceptionMethodInvocationExceptionParseErrorExceptionResourceNotFoundException- See Also:
-
execute
- Specified by:
executein 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:NodeMark the node as invalid.- Specified by:
setInvalidin interfaceNode- See Also:
-
isInvalid
public boolean isInvalid() -
getLine
public int getLine() -
getColumn
public int getColumn() -
toString
-
getTemplateName
- Specified by:
getTemplateNamein interfaceNode- Returns:
- the file name of the template
-