org.apache.velocity.runtime.parser.node
Class ASTReference
- Node
public class ASTReference
This class is responsible for handling the references in
VTL ($foo).
Please look at the Parser.jjt file which is
what controls the generation of this class.
$Id: ASTReference.java,v 1.49.4.1 2004/03/03 23:22:59 geirm Exp $
childrenAccept , dump , evaluate , execute , getColumn , getFirstToken , getInfo , getLastToken , getLine , getType , init , isInvalid , jjtAccept , jjtAddChild , jjtClose , jjtGetChild , jjtGetNumChildren , jjtGetParent , jjtOpen , jjtSetParent , literal , render , setFirstToken , setInfo , setInvalid , toString , value |
FORMAL_REFERENCE
private static final int FORMAL_REFERENCE
NORMAL_REFERENCE
private static final int NORMAL_REFERENCE
QUIET_REFERENCE
private static final int QUIET_REFERENCE
RUNT
private static final int RUNT
computableReference
private boolean computableReference
escPrefix
private String escPrefix
escaped
private boolean escaped
identifier
private String identifier
literal
private String literal
morePrefix
private String morePrefix
nullString
private String nullString
numChildren
private int numChildren
referenceType
private int referenceType
rootString
private String rootString
uberInfo
protected Info uberInfo
ASTReference
public ASTReference(int id)
ASTReference
public ASTReference(Parser p,
int id)
getRoot
private String getRoot()
getRootString
public String getRootString()
Returns the 'root string', the reference key
getVariableValue
public Object getVariableValue(Context context,
String variable)
literal
public String literal()
Override of the SimpleNode method literal()
Returns the literal representation of the
node. Should be something like
$.
- literal in interface Node
- literal in interface SimpleNode
setLiteral
public void setLiteral(String literal)
Routine to allow the literal representation to be
externally overridden. Used now in the VM system
to override a reference in a VM tree with the
literal of the calling arg to make it work nicely
when calling arg is null. It seems a bit much, but
does keep things consistant.
Note, you can only set the literal once...
literal
- String to render to when null
setValue
public boolean setValue(InternalContextAdapter context,
Object value)
throws MethodInvocationException
Sets the value of a complex reference (something like $foo.bar)
Currently used by ASTSetReference()
context
- context object containing this referencevalue
- Object to set as value
- true if successful, false otherwise
Copyright B) 2002 Apache Software Foundation. All Rights Reserved.