org.apache.velocity.runtime.parser.node

Class ASTDirective

Implemented Interfaces:
Node

public class ASTDirective
extends SimpleNode

This class is responsible for handling the pluggable directives in VTL. ex. #foreach() Please look at the Parser.jjt file which is what controls the generation of this class.

Version:
$Id: ASTDirective.java,v 1.21.4.1 2004/03/03 23:22:58 geirm Exp $

Authors:
Jason van Zyl
Geir Magnusson Jr.
Kasper Nielsen

Field Summary

private Directive
directive
private String
directiveName
private boolean
isDirective

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

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

Constructor Summary

ASTDirective(int id)
ASTDirective(Parser p, int id)

Method Summary

String
getDirectiveName()
Gets the name of this directive.
Object
init(InternalContextAdapter context, Object data)
Object
jjtAccept(ParserVisitor visitor, Object data)
Accept the visitor.
boolean
render(InternalContextAdapter context, Writer writer)
void
setDirectiveName(String str)
Sets the directive name.

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

directive

private Directive directive


directiveName

private String directiveName


isDirective

private boolean isDirective

Constructor Details

ASTDirective

public ASTDirective(int id)


ASTDirective

public ASTDirective(Parser p,
                    int id)

Method Details

getDirectiveName

public String getDirectiveName()
Gets the name of this directive.


init

public Object init(InternalContextAdapter context,
                   Object data)
            throws Exception
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,
                   ResourceNotFoundException,
                   ParseErrorException
Specified by:
render in interface Node
Overrides:
render in interface SimpleNode


setDirectiveName

public void setDirectiveName(String str)
Sets the directive name. Used by the parser. This keeps us from having to dig it out of the token stream and gives the parse the change to override.


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