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 Objectexecute(Object o, InternalContextAdapter context)StringgetIdentifier()Identifier getterObjectinit(InternalContextAdapter context, Object data)simple init - don't do anything that is context specific.ObjectjjtAccept(StandardParserVisitor visitor, Object data)Stringliteral()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:
jjtAcceptin interfaceNode- Overrides:
jjtAcceptin 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:
initin interfaceNode- Overrides:
initin 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:
executein interfaceNode- Overrides:
executein 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:
literalin interfaceNode- Overrides:
literalin classSimpleNode- Returns:
- See Also:
Node.literal()
-
-