Class ASTMethod
java.lang.Object
org.apache.velocity.runtime.parser.node.SimpleNode
org.apache.velocity.runtime.parser.node.ASTMethod
- All Implemented Interfaces:
Cloneable
,Node
,Renderable
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$
- Author:
- Jason van Zyl, Geir Magnusson Jr.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Internal class used as key for method cache. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Indicates if we are running in strict reference mode.protected Info
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute
(Object o, InternalContextAdapter context) invokes the method.init
(InternalContextAdapter context, Object data) simple init - init our subtree and get what we can from the ASTjjtAccept
(StandardParserVisitor visitor, Object data) literal()
Returns the string ".method_name(...)".Methods inherited from class org.apache.velocity.runtime.parser.node.SimpleNode
childrenAccept, cleanupParserAndTokens, clone, clone, dump, dump, dump, evaluate, getColumn, getFirstToken, getFirstTokenImage, getInfo, getLastToken, getLastTokenImage, getLine, getLocation, getParser, getRuntimeServices, getTemplate, getTemplateName, getType, isInvalid, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, render, saveTokenImages, setFirstToken, setInfo, setInvalid, toString, toString, value
-
Field Details
-
uberInfo
-
strictRef
protected boolean strictRefIndicates if we are running in strict reference mode.
-
-
Constructor Details
-
ASTMethod
public ASTMethod(int id) - Parameters:
id
-
-
ASTMethod
- Parameters:
p
-id
-
-
-
Method Details
-
jjtAccept
- Specified by:
jjtAccept
in interfaceNode
- Overrides:
jjtAccept
in classSimpleNode
- Parameters:
visitor
-data
-- Returns:
- The Node execution result object.
- See Also:
-
init
simple init - init our subtree and get what we can from the AST- Specified by:
init
in interfaceNode
- Overrides:
init
in classSimpleNode
- Parameters:
context
-data
-- Returns:
- The init result
- Throws:
TemplateInitException
- See Also:
-
execute
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 interfaceNode
- Overrides:
execute
in classSimpleNode
- Parameters:
o
-context
-- Returns:
- Result or null.
- Throws:
MethodInvocationException
- See Also:
-
getMethodName
- Returns:
- Returns the methodName.
- Since:
- 1.5
-
literal
Returns the string ".method_name(...)". Arguments literals are not rendered. This method is only used for displaying the VTL stacktrace when a rendering error is encountered when runtime.log.track_location is true.- Specified by:
literal
in interfaceNode
- Overrides:
literal
in classSimpleNode
- Returns:
- See Also:
-