velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: AW: Features are complete ?
Date Thu, 01 Feb 2001 19:47:56 GMT
Ok.  I just checked into the whiteboard a new class : Velocity.java

To get it, update your CVS tree, or just use the online CVS browser to
download a copy.

NOTE : this should be dropped into your source tree in
src/java/org/apache/velocity/util

The point of this class is to become the application utility class. I
hope that it might :

1) Be the interface to the velocity core, so we can wean application
programmers from calling Runtime methods directly.  This would decouple
the Velocity application API from the internal implementation, making
life better for all.  

2) providing both useful and interesting application-level utility
functions that we want to support.

Anyhow, Thomas et al, give the evaluate() function a try...

I used it thus :

  context.put("Floog", "floogie woogie");
  context.put("name", "geir");

  String stest = " My name is $name -> $Floog";
  StringWriter w = new StringWriter();
  
  Velocity.evaluate( context, w, stest );
  
  System.out.println("Eval = " + w );

let us know how it works...

geir


"Geir Magnusson Jr." wrote:
> 
> Jon Stevens wrote:
> >
> > on 2/1/01 9:44 AM, "Thomas Fahrmeyer" <thomas.fahrmeyer@einsurance.de>
> > wrote:
> >
> > > Hmm, I'm confused too ;))
> > >
> > > I got the nightly build (02/01/01) and can't find any
> > > InputStreamTemplateLoader ;(
> > >
> > > It sounds as if that is what I want to have. I build something similar by
> > > myself.
> > >
> > > bye
> > > Thomas
> >
> > Exactly. I'm saying to you that that is the right way to implement such
> > functionality. I'm not saying that it already exists.
> 
> I'm not sure about this, y'all.  I think that as it's an application
> type of thing that seems to be needed, then an application API type of
> solution would be good.  What I mean by this is that he doesn't need any
> of the 'infrastructure' to do this.
> 
> I am testing now an eval() function in the Velocity helper class not to
> be used in a template, but in the Java code w/o any real difficulty.
> 
> it's   public boolean evaluate( Context, Writer, String)
> or     public boolean evaluate( Context, Writer, InputStream)
> 
> If I can remember to import correctly, I will have this in the
> whiteboard in the next few minutes...
> 
> --
> Geir Magnusson Jr.                               geirm@optonline.com
> Velocity : it's not just a good idea. It should be the law.
> http://jakarta.apache.org/velocity

-- 
Geir Magnusson Jr.                               geirm@optonline.com
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity

Mime
View raw message