org.apache.velocity.runtime.parser.node
Class ASTIdentifier

java.lang.Object
  extended by org.apache.velocity.runtime.parser.node.SimpleNode
      extended by org.apache.velocity.runtime.parser.node.ASTIdentifier
All Implemented Interfaces:
Node

public class ASTIdentifier
extends SimpleNode

ASTIdentifier.java Method support for identifiers : $foo mainly used by ASTRefrence 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: ASTIdentifier.java 191743 2005-06-21 23:22:20Z dlr $
Author:
Jason van Zyl, Geir Magnusson Jr.

Field Summary
protected  Info uberInfo
          This is really immutable after the init, so keep one for this node
 
Fields inherited from class org.apache.velocity.runtime.parser.node.SimpleNode
children, first, id, info, invalid, last, parent, parser, rsvc, state
 
Constructor Summary
ASTIdentifier(int id)
           
ASTIdentifier(Parser p, int id)
           
 
Method Summary
 Object execute(Object o, InternalContextAdapter context)
          invokes the method on the object passed in
 Object init(InternalContextAdapter context, Object data)
          simple init - don't do anything that is context specific.
 Object jjtAccept(ParserVisitor visitor, Object data)
          Accept the visitor.
 
Methods inherited from class org.apache.velocity.runtime.parser.node.SimpleNode
childrenAccept, dump, evaluate, getColumn, getFirstToken, getInfo, getLastToken, getLine, getLocation, getLocation, getType, isInvalid, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, literal, render, setFirstToken, setInfo, setInvalid, toString, value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uberInfo

protected Info uberInfo
This is really immutable after the init, so keep one for this node

Constructor Detail

ASTIdentifier

public ASTIdentifier(int id)

ASTIdentifier

public ASTIdentifier(Parser p,
                     int id)
Method Detail

jjtAccept

public Object jjtAccept(ParserVisitor visitor,
                        Object data)
Accept the visitor.

Specified by:
jjtAccept in interface Node
Overrides:
jjtAccept in class SimpleNode

init

public Object init(InternalContextAdapter context,
                   Object data)
            throws Exception
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 interface Node
Overrides:
init in class SimpleNode
Throws:
Exception

execute

public Object execute(Object o,
                      InternalContextAdapter context)
               throws MethodInvocationException
invokes the method on the object passed in

Specified by:
execute in interface Node
Overrides:
execute in class SimpleNode
Throws:
MethodInvocationException


Copyright © 2002 Apache Software Foundation. All Rights Reserved.