|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.velocity.runtime.parser.node.SimpleNode org.apache.velocity.runtime.parser.node.ASTReference
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.
Field Summary | |
---|---|
boolean |
strictEscape
Indicates if we are using modified escape behavior in strict mode. |
boolean |
strictRef
Indicates if we are running in strict reference mode. |
boolean |
toStringNullCheck
Indicates if toString() should be called during condition evaluation just to ensure it does not return null. |
protected Info |
uberInfo
|
Fields inherited from class org.apache.velocity.runtime.parser.node.SimpleNode |
---|
children, first, id, info, invalid, last, log, parent, parser, rsvc, state, templateName |
Constructor Summary | |
---|---|
ASTReference(int id)
|
|
ASTReference(Parser p,
int id)
|
Method Summary | |
---|---|
boolean |
evaluate(InternalContextAdapter context)
Computes boolean value of this reference Returns the actual value of reference return type boolean, and 'true' if value is not null |
Object |
execute(Object o,
InternalContextAdapter context)
gets an Object that 'is' the value of the reference |
String |
getDollarBang()
|
String |
getRootString()
Returns the 'root string', the reference key |
Object |
getVariableValue(Context context,
String variable)
|
Object |
init(InternalContextAdapter context,
Object data)
|
Object |
jjtAccept(ParserVisitor visitor,
Object data)
|
static String |
printClass(Class clazz)
Utility class to handle nulls when printing a class type |
boolean |
render(InternalContextAdapter context,
Writer writer)
gets the value of the reference and outputs it to the writer. |
boolean |
setValue(InternalContextAdapter context,
Object value)
Sets the value of a complex reference (something like $foo.bar) Currently used by ASTSetReference() |
Object |
value(InternalContextAdapter context)
|
Methods inherited from class org.apache.velocity.runtime.parser.node.SimpleNode |
---|
childrenAccept, dump, getColumn, getFirstToken, getInfo, getLastToken, getLine, getLocation, getRuntimeServices, getTemplateName, getType, isInvalid, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, literal, setFirstToken, setInfo, setInvalid, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public boolean strictRef
public boolean strictEscape
public boolean toStringNullCheck
protected Info uberInfo
Constructor Detail |
---|
public ASTReference(int id)
id
- public ASTReference(Parser p, int id)
p
- id
- Method Detail |
---|
public Object jjtAccept(ParserVisitor visitor, Object data)
jjtAccept
in interface Node
jjtAccept
in class SimpleNode
SimpleNode.jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object)
public Object init(InternalContextAdapter context, Object data) throws TemplateInitException
init
in interface Node
init
in class SimpleNode
TemplateInitException
SimpleNode.init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)
public String getRootString()
public Object execute(Object o, InternalContextAdapter context) throws MethodInvocationException
execute
in interface Node
execute
in class SimpleNode
o
- unused Object parametercontext
- context used to generate value
MethodInvocationException
Node.execute(java.lang.Object, org.apache.velocity.context.InternalContextAdapter)
public boolean render(InternalContextAdapter context, Writer writer) throws IOException, MethodInvocationException
render
in interface Node
render
in interface Renderable
render
in class SimpleNode
context
- context of data to use in getting valuewriter
- writer to render to
IOException
MethodInvocationException
Node.render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer)
public boolean evaluate(InternalContextAdapter context) throws MethodInvocationException
evaluate
in interface Node
evaluate
in class SimpleNode
context
- context to compute value with
MethodInvocationException
Node.evaluate(org.apache.velocity.context.InternalContextAdapter)
public Object value(InternalContextAdapter context) throws MethodInvocationException
value
in interface Node
value
in class SimpleNode
MethodInvocationException
SimpleNode.value(org.apache.velocity.context.InternalContextAdapter)
public static String printClass(Class clazz)
public boolean setValue(InternalContextAdapter context, Object value) throws MethodInvocationException
context
- context object containing this referencevalue
- Object to set as value
MethodInvocationException
ASTSetDirective
public Object getVariableValue(Context context, String variable) throws MethodInvocationException
context
- variable
-
MethodInvocationException
public String getDollarBang()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |