Class ASTIdentifier
- java.lang.Object
-
- org.apache.velocity.runtime.parser.node.SimpleNode
-
- org.apache.velocity.runtime.parser.node.ASTIdentifier
-
- All Implemented Interfaces:
Cloneable
,Node
,Renderable
public class ASTIdentifier extends SimpleNode
ASTIdentifier.java Method support for identifiers : $foo mainly used by ASTReference Introspection is now moved to 'just in time' or at render / execution time. There are many reasons why this has to be done, but the primary two are thread safety, to remove any context-derived information from class member variables.- Version:
- $Id$
- Author:
- Jason van Zyl, Geir Magnusson Jr.
-
-
Constructor Summary
Constructors Constructor Description ASTIdentifier(int id)
ASTIdentifier(Parser p, int id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
execute(Object o, InternalContextAdapter context)
String
getIdentifier()
Identifier getterObject
init(InternalContextAdapter context, Object data)
simple init - don't do anything that is context specific.Object
jjtAccept(StandardParserVisitor visitor, Object data)
String
literal()
Returns the string ".identifier".-
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 Detail
-
uberInfo
protected Info uberInfo
This is really immutable after the init, so keep one for this node
-
strictRef
protected boolean strictRef
Indicates if we are running in strict reference mode.
-
-
Constructor Detail
-
ASTIdentifier
public ASTIdentifier(int id)
- Parameters:
id
-
-
ASTIdentifier
public ASTIdentifier(Parser p, int id)
- Parameters:
p
-id
-
-
-
Method Detail
-
getIdentifier
public String getIdentifier()
Identifier getter- Returns:
- identifier
-
jjtAccept
public Object jjtAccept(StandardParserVisitor visitor, Object data)
- Specified by:
jjtAccept
in interfaceNode
- Overrides:
jjtAccept
in classSimpleNode
- Returns:
- The Node execution result object.
- See Also:
SimpleNode.jjtAccept(org.apache.velocity.runtime.parser.node.StandardParserVisitor, java.lang.Object)
-
init
public Object init(InternalContextAdapter context, Object data) throws TemplateInitException
simple init - don't do anything that is context specific. just get what we need from the AST, which is static.- Specified by:
init
in interfaceNode
- Overrides:
init
in classSimpleNode
- Parameters:
context
-data
-- Returns:
- The data object.
- Throws:
TemplateInitException
- See Also:
Node.init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)
-
execute
public Object execute(Object o, InternalContextAdapter context) throws MethodInvocationException
- Specified by:
execute
in interfaceNode
- Overrides:
execute
in classSimpleNode
- Returns:
- The execution result.
- Throws:
MethodInvocationException
- See Also:
SimpleNode.execute(java.lang.Object, org.apache.velocity.context.InternalContextAdapter)
-
literal
public String literal()
Returns the string ".identifier". 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:
Node.literal()
-
-