org.apache.velocity.runtime.visitor

Class VMReferenceMungeVisitor

Implemented Interfaces:
ParserVisitor

public class VMReferenceMungeVisitor
extends BaseVisitor

This class is a visitor used by the VM proxy to change the literal representation of a reference in a VM. The reason is to preserve the 'render literal if null' behavior w/o making the VMProxy stuff more complicated than it is already.

Version:
$Id: VMReferenceMungeVisitor.java,v 1.2.4.1 2004/03/03 23:23:03 geirm Exp $

Author:
Geir Magnusson Jr.

Field Summary

private Map
argmap
Map containing VM arg to instance-use reference Passed in with CTOR

Fields inherited from class org.apache.velocity.runtime.visitor.BaseVisitor

context, writer

Constructor Summary

VMReferenceMungeVisitor(Map map)
CTOR - takes a map of args to reference

Method Summary

Object
visit(ASTReference node, Object data)
Visitor method - if the literal is right, will set the literal in the ASTReference node

Methods inherited from class org.apache.velocity.runtime.visitor.BaseVisitor

setContext, setWriter, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit

Field Details

argmap

private Map argmap
Map containing VM arg to instance-use reference Passed in with CTOR

Constructor Details

VMReferenceMungeVisitor

public VMReferenceMungeVisitor(Map map)
CTOR - takes a map of args to reference

Method Details

visit

public Object visit(ASTReference node,
                    Object data)
Visitor method - if the literal is right, will set the literal in the ASTReference node
Specified by:
visit in interface ParserVisitor
Overrides:
visit in interface BaseVisitor

Parameters:
node - ASTReference to work on
data - Object to pass down from caller


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