org.apache.velocity.runtime.visitor
Class BaseVisitor

java.lang.Object
  extended by org.apache.velocity.runtime.visitor.BaseVisitor
All Implemented Interfaces:
ParserVisitor
Direct Known Subclasses:
NodeViewMode, VMReferenceMungeVisitor

public abstract class BaseVisitor
extends Object
implements ParserVisitor

This is the base class for all visitors. For each AST node, this class will provide a bare-bones method for traversal.

Version:
$Id: BaseVisitor.java 151484 2005-02-05 07:09:52Z wglass $
Author:
Jason van Zyl, Geir Magnusson Jr.

Field Summary
protected  InternalContextAdapter context
          Context used during traversal
protected  Writer writer
          Writer used as the output sink
 
Constructor Summary
BaseVisitor()
           
 
Method Summary
 void setContext(InternalContextAdapter context)
           
 void setWriter(Writer writer)
           
 Object visit(ASTAddNode node, Object data)
           
 Object visit(ASTAndNode node, Object data)
           
 Object visit(ASTAssignment node, Object data)
           
 Object visit(ASTBlock node, Object data)
           
 Object visit(ASTComment node, Object data)
           
 Object visit(ASTDirective node, Object data)
           
 Object visit(ASTDivNode node, Object data)
           
 Object visit(ASTElseIfStatement node, Object data)
           
 Object visit(ASTElseStatement node, Object data)
           
 Object visit(ASTEQNode node, Object data)
           
 Object visit(ASTExpression node, Object data)
           
 Object visit(ASTFalse node, Object data)
           
 Object visit(ASTFloatingPointLiteral node, Object data)
           
 Object visit(ASTGENode node, Object data)
           
 Object visit(ASTGTNode node, Object data)
           
 Object visit(ASTIdentifier node, Object data)
           
 Object visit(ASTIfStatement node, Object data)
           
 Object visit(ASTIntegerLiteral node, Object data)
           
 Object visit(ASTLENode node, Object data)
           
 Object visit(ASTLTNode node, Object data)
           
 Object visit(ASTMethod node, Object data)
           
 Object visit(ASTModNode node, Object data)
           
 Object visit(ASTMulNode node, Object data)
           
 Object visit(ASTNENode node, Object data)
           
 Object visit(ASTNotNode node, Object data)
           
 Object visit(ASTObjectArray node, Object data)
           
 Object visit(ASTOrNode node, Object data)
           
 Object visit(ASTprocess node, Object data)
           
 Object visit(ASTReference node, Object data)
           
 Object visit(ASTSetDirective node, Object data)
           
 Object visit(ASTStringLiteral node, Object data)
           
 Object visit(ASTSubtractNode node, Object data)
           
 Object visit(ASTText node, Object data)
           
 Object visit(ASTTrue node, Object data)
           
 Object visit(ASTWord node, Object data)
           
 Object visit(SimpleNode node, Object data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected InternalContextAdapter context
Context used during traversal


writer

protected Writer writer
Writer used as the output sink

Constructor Detail

BaseVisitor

public BaseVisitor()
Method Detail

setWriter

public void setWriter(Writer writer)

setContext

public void setContext(InternalContextAdapter context)

visit

public Object visit(SimpleNode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTprocess node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTExpression node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTAssignment node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTOrNode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTAndNode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTEQNode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTNENode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTLTNode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTGTNode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTLENode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTGENode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTAddNode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTSubtractNode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTMulNode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTDivNode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTModNode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTNotNode node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTIntegerLiteral node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTFloatingPointLiteral node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTStringLiteral node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTIdentifier node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTMethod node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTReference node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTTrue node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTFalse node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTBlock node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTText node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTIfStatement node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTElseStatement node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTElseIfStatement node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTComment node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTObjectArray node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTWord node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTSetDirective node,
                    Object data)
Specified by:
visit in interface ParserVisitor

visit

public Object visit(ASTDirective node,
                    Object data)
Specified by:
visit in interface ParserVisitor


Copyright © 2002 Apache Software Foundation. All Rights Reserved.