org.apache.velocity.runtime.parser.node

Class ASTSetDirective

Implemented Interfaces:
Node

public class ASTSetDirective
extends SimpleNode

Node for the #set directive

Version:
$Id: ASTSetDirective.java,v 1.22.4.1 2004/03/03 23:22:59 geirm Exp $

Authors:
Jason van Zyl
Geir Magnusson Jr.

Field Summary

(package private) boolean
blather
private ASTReference
left
private String
leftReference
private Node
right

Fields inherited from class org.apache.velocity.runtime.parser.node.SimpleNode

children, first, id, info, invalid, last, parent, parser, rsvc, state

Constructor Summary

ASTSetDirective(int id)
ASTSetDirective(Parser p, int id)

Method Summary

private ASTReference
getLeftHandSide()
returns the ASTReference that is the LHS of the set statememt
private Node
getRightHandSide()
returns the RHS Node of the set statement
Object
init(InternalContextAdapter context, Object data)
simple init.
Object
jjtAccept(ParserVisitor visitor, Object data)
Accept the visitor.
boolean
render(InternalContextAdapter context, Writer writer)
puts the value of the RHS into the context under the key of the LHS

Methods inherited from class org.apache.velocity.runtime.parser.node.SimpleNode

childrenAccept, dump, evaluate, execute, getColumn, getFirstToken, getInfo, getLastToken, getLine, getType, init, isInvalid, jjtAccept, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, literal, render, setFirstToken, setInfo, setInvalid, toString, value

Field Details

blather

(package private)  boolean blather


left

private ASTReference left


leftReference

private String leftReference


right

private Node right

Constructor Details

ASTSetDirective

public ASTSetDirective(int id)


ASTSetDirective

public ASTSetDirective(Parser p,
                       int id)

Method Details

getLeftHandSide

private ASTReference getLeftHandSide()
returns the ASTReference that is the LHS of the set statememt


getRightHandSide

private Node getRightHandSide()
returns the RHS Node of the set statement


init

public Object init(InternalContextAdapter context,
                   Object data)
            throws Exception
simple init. We can get the RHS and LHS as the the tree structure is static
Specified by:
init in interface Node
Overrides:
init in interface SimpleNode


jjtAccept

public Object jjtAccept(ParserVisitor visitor,
                        Object data)
Accept the visitor. *
Specified by:
jjtAccept in interface Node
Overrides:
jjtAccept in interface SimpleNode


render

public boolean render(InternalContextAdapter context,
                      Writer writer)
            throws IOException,
                   MethodInvocationException
puts the value of the RHS into the context under the key of the LHS
Specified by:
render in interface Node
Overrides:
render in interface SimpleNode


Copyright B) 2002 Apache Software Foundation. All Rights Reserved.