org.apache.velocity.runtime.parser.node

Class SimpleNode

Implemented Interfaces:
Node
Known Direct Subclasses:
ASTAddNode, ASTAndNode, ASTAssignment, ASTBlock, ASTComment, ASTDirective, ASTDivNode, ASTElseIfStatement, ASTElseStatement, ASTEQNode, ASTEscape, ASTEscapedDirective, ASTExpression, ASTFalse, ASTGENode, ASTGTNode, ASTIdentifier, ASTIfStatement, ASTIncludeStatement, ASTIntegerRange, ASTLENode, ASTLTNode, ASTMethod, ASTModNode, ASTMulNode, ASTNENode, ASTNotNode, ASTNumberLiteral, ASTObjectArray, ASTOrNode, ASTprocess, ASTParameters, ASTReference, ASTSetDirective, ASTStringLiteral, ASTSubtractNode, ASTText, ASTTrue, ASTVariable, ASTWord

public class SimpleNode
extends java.lang.Object
implements Node

Field Summary

protected Node[]
children
protected Token
first
protected int
id
protected int
info
protected boolean
invalid
protected Token
last
protected Node
parent
protected Parser
parser
protected RuntimeServices
rsvc
boolean
state

Constructor Summary

SimpleNode(int i)
SimpleNode(Parser p, int i)

Method Summary

Object
childrenAccept(ParserVisitor visitor, Object data)
Accept the visitor.
void
dump(String prefix)
boolean
evaluate(InternalContextAdapter context)
Object
execute(Object o, InternalContextAdapter context)
int
getColumn()
Token
getFirstToken()
int
getInfo()
Token
getLastToken()
int
getLine()
int
getType()
Object
init(InternalContextAdapter context, Object data)
boolean
isInvalid()
Object
jjtAccept(ParserVisitor visitor, Object data)
Accept the visitor.
void
jjtAddChild(Node n, int i)
void
jjtClose()
Node
jjtGetChild(int i)
int
jjtGetNumChildren()
Node
jjtGetParent()
void
jjtOpen()
void
jjtSetParent(Node n)
String
literal()
boolean
render(InternalContextAdapter context, Writer writer)
void
setFirstToken(Token t)
void
setInfo(int info)
void
setInvalid()
String
toString(String prefix)
Object
value(InternalContextAdapter context)

Field Details

children

protected Node[] children

first

protected Token first

id

protected int id

info

protected int info

invalid

protected boolean invalid

last

protected Token last

parent

protected Node parent

parser

protected Parser parser

rsvc

protected RuntimeServices rsvc

state

public boolean state

Constructor Details

SimpleNode

public SimpleNode(int i)

SimpleNode

public SimpleNode(Parser p,
                  int i)

Method Details

childrenAccept

public Object childrenAccept(ParserVisitor visitor,
                             Object data)
Accept the visitor. *
Specified by:
childrenAccept in interface Node

dump

public void dump(String prefix)

evaluate

public boolean evaluate(InternalContextAdapter context)
            throws MethodInvocationException
Specified by:
evaluate in interface Node

execute

public Object execute(Object o,
                      InternalContextAdapter context)
            throws MethodInvocationException
Specified by:
execute in interface Node

getColumn

public int getColumn()
Specified by:
getColumn in interface Node

getFirstToken

public Token getFirstToken()
Specified by:
getFirstToken in interface Node

getInfo

public int getInfo()
Specified by:
getInfo in interface Node

getLastToken

public Token getLastToken()
Specified by:
getLastToken in interface Node

getLine

public int getLine()
Specified by:
getLine in interface Node

getType

public int getType()
Specified by:
getType in interface Node

init

public Object init(InternalContextAdapter context,
                   Object data)
            throws Exception
Specified by:
init in interface Node

isInvalid

public boolean isInvalid()
Specified by:
isInvalid in interface Node

jjtAccept

public Object jjtAccept(ParserVisitor visitor,
                        Object data)
Accept the visitor. *
Specified by:
jjtAccept in interface Node

jjtAddChild

public void jjtAddChild(Node n,
                        int i)
Specified by:
jjtAddChild in interface Node

jjtClose

public void jjtClose()
Specified by:
jjtClose in interface Node

jjtGetChild

public Node jjtGetChild(int i)
Specified by:
jjtGetChild in interface Node

jjtGetNumChildren

public int jjtGetNumChildren()
Specified by:
jjtGetNumChildren in interface Node

jjtGetParent

public Node jjtGetParent()
Specified by:
jjtGetParent in interface Node

jjtOpen

public void jjtOpen()
Specified by:
jjtOpen in interface Node

jjtSetParent

public void jjtSetParent(Node n)
Specified by:
jjtSetParent in interface Node

literal

public String literal()
Specified by:
literal in interface Node

render

public boolean render(InternalContextAdapter context,
                      Writer writer)
            throws IOException,
                   MethodInvocationException,
                   ParseErrorException,
                   ResourceNotFoundException
Specified by:
render in interface Node

setFirstToken

public void setFirstToken(Token t)

setInfo

public void setInfo(int info)
Specified by:
setInfo in interface Node

setInvalid

public void setInvalid()
Specified by:
setInvalid in interface Node

toString

public String toString(String prefix)

value

public Object value(InternalContextAdapter context)
            throws MethodInvocationException
Specified by:
value in interface Node

Copyright B) 2002 Apache Software Foundation. All Rights Reserved.