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: why no StringBufferResourceLoader ?
Date Mon, 08 Apr 2002 18:08:21 GMT
On 4/7/02 10:38 PM, "Stephen Riek" <stephenriek@yahoo.co.uk> wrote:

> 
> I'm intrigued. Velocity supports a FileResourceLoader,
> DataSourceResourceLoader, ClasspathResourceLoader and even JarResourceLoader
> but why is there no mechanism for using a simple String or StringBuffer
> object. I would have thought it most useful and convenient, but presume that
> there is a design reason for not including it ?

Making a formal loader for a StringBuffer doesn't make too much sense, as
the concept of a loader is such that it *loads* template from a source.

However, the application API supports you supplying a String, InputStream or
Reader as the source of the template, which I think is what you are looking
for.

See the evaluate() methods in class org.apache.velocity.app.Velocity (if you
are using the singleton model) or o.a.v.app.VelocityEngine (if you are using
the 'separate instance' model.)

Geir

-- 
Geir Magnusson Jr.                       geirm@optonline.net
System and Software Consulting
You're going to end up getting pissed at your software
anyway, so you might as well not pay for it. Try Open Source.



--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message