velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason van Zyl <jvan...@periapt.com>
Subject Re: [Proposal] ProcessVisitor Base Class
Date Tue, 29 Aug 2000 16:30:25 GMT
On Tue, 29 Aug 2000, Leon Messerschmidt wrote:

> Hi,
> 
> This might be totally the wrong idea, so please correct me if I'm wrong...
> 
> I want to use Velocity for XML templates.  I'd like two basic
> functionalities for this (1) the ability to replace xml entities when
> variables are inserted (2) to get the output through a PrintWriter.  The
> rest should be exactly the same.
> 
> What I would like to propose is a base class for ProcessVisitor - maybe
> something called Processor (??) .  This base class has two abstract methods:
> 
> protected void print(String text, int x, int y, int columnAdjustment)
> protected String parseVariable (String var)
> 
> A derived ProcessVisitor does the same in the print() method and nothing for
> the parseVariable() method.  Other visitors that extend the base class can
> print to a PrintWriter in the print() method and replace xml entities in the
> parseVariable() method.  This way I (and some other people) can add some
> speciality functions without duplicating the Processor code.
> 
> Does this sound useful or am I completely missing the boat?

Yes I want to make a base class, but I sort leaving everything
in "expanded" format until we basically decide what the total
syntax is going to be because that affects the visitors.

I am also trying to think of ways to somehow eliminate all
the Node visitors and somehow use polymorphism. Collapse
everything down and optimize as Bob has suggested. But
it would be good to have a document that we agree on.
Jon has documented the script elements on the Velocity
web site. We should decide what else is desired, once
that is settled then we can start collapsing, and cleaning
up the code. The visitors are a bit messy right now,
but they are in their most flexible state that
way.

jvz.

-- 

Jason van Zyl
jvanzyl@periapt.com


Mime
View raw message