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
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.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Indicates if we are running in strict reference mode.protected Info
This is really immutable after the init, so keep one for this node -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionexecute
(Object o, InternalContextAdapter context) Identifier getterinit
(InternalContextAdapter context, Object data) simple init - don't do anything that is context specific.jjtAccept
(StandardParserVisitor visitor, Object data) 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 Details
-
uberInfo
This is really immutable after the init, so keep one for this node -
strictRef
protected boolean strictRefIndicates if we are running in strict reference mode.
-
-
Constructor Details
-
ASTIdentifier
public ASTIdentifier(int id) - Parameters:
id
-
-
ASTIdentifier
- Parameters:
p
-id
-
-
-
Method Details
-
getIdentifier
Identifier getter- Returns:
- identifier
-
jjtAccept
- Specified by:
jjtAccept
in interfaceNode
- Overrides:
jjtAccept
in classSimpleNode
- Parameters:
visitor
-data
-- Returns:
- The Node execution result object.
- See Also:
-
init
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:
-
execute
- Specified by:
execute
in interfaceNode
- Overrides:
execute
in classSimpleNode
- Parameters:
o
-context
-- Returns:
- The execution result.
- Throws:
MethodInvocationException
- See Also:
-
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:
-