org.apache.velocity.runtime.parser.node
Class ASTMethod
java.lang.Object
org.apache.velocity.runtime.parser.node.SimpleNode
org.apache.velocity.runtime.parser.node.ASTMethod
- All Implemented Interfaces:
- Node
public class ASTMethod
- extends SimpleNode
ASTMethod.java
Method support for references : $foo.method()
NOTE :
introspection is now done at render time.
Please look at the Parser.jjt file which is
what controls the generation of this class.
- Version:
- $Id: ASTMethod.java 720228 2008-11-24 16:58:33Z nbubna $
- Author:
- Jason van Zyl, Geir Magnusson Jr.
Field Summary |
protected boolean |
strictRef
Indicates if we are running in strict reference mode. |
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 |
Methods inherited from class org.apache.velocity.runtime.parser.node.SimpleNode |
childrenAccept, dump, evaluate, getColumn, getFirstToken, getInfo, getLastToken, getLine, getLocation, getTemplateName, getType, isInvalid, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, literal, render, setFirstToken, setInfo, setInvalid, toString, toString, value |
uberInfo
protected Info uberInfo
strictRef
protected boolean strictRef
- Indicates if we are running in strict reference mode.
ASTMethod
public ASTMethod(int id)
- Parameters:
id
-
ASTMethod
public ASTMethod(Parser p,
int id)
- Parameters:
p
- id
-
jjtAccept
public Object jjtAccept(ParserVisitor visitor,
Object data)
- Specified by:
jjtAccept
in interface Node
- Overrides:
jjtAccept
in class SimpleNode
- Returns:
- The Node execution result object.
- See Also:
SimpleNode.jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object)
init
public Object init(InternalContextAdapter context,
Object data)
throws TemplateInitException
- simple init - init our subtree and get what we can from
the AST
- Specified by:
init
in interface Node
- Overrides:
init
in class SimpleNode
- Parameters:
context
- data
-
- Returns:
- The init result
- Throws:
TemplateInitException
- See Also:
Node.init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)
execute
public Object execute(Object o,
InternalContextAdapter context)
throws MethodInvocationException
- invokes the method. Returns null if a problem, the
actual return if the method returns something, or
an empty string "" if the method returns void
- Specified by:
execute
in interface Node
- Overrides:
execute
in class SimpleNode
- Parameters:
o
- context
-
- Returns:
- Result or null.
- Throws:
MethodInvocationException
- See Also:
Node.execute(java.lang.Object, org.apache.velocity.context.InternalContextAdapter)
getMethodName
public String getMethodName()
- Returns:
- Returns the methodName.
- Since:
- 1.5
Copyright © 2000-2008 The Apache Software Foundation. All Rights Reserved.