[stringtemplate-interest] Escaping

Terence Parr parrt at cs.usfca.edu
Tue May 3 16:10:21 PDT 2005


On May 3, 2005, at 2:32 PM, Tom Bentley wrote:

> > Your controller wraps objects
>> such as name in other objects that render it according to the target. 
>>  I'm thinking of adding a mapping that lets you just once say "wrap 
>> all String objects in HTMLStringRenderer objects".
>
> So you can simply add a Renderer to a template (much as you can set 
> attributes on it), and the renderer is in charge of converting Objects 
> to Strings...? If the don't add a renderer you'd get the default 
> renderer, which just uses Object.toString(), as we have at the moment 
> (thogh doesn't it convert null to the empty string?).
>
> It seems the simple and obvious way to do it, and I like simple and 
> obvious things!

Yep, should work.  I have it on the list of things to do. :)

Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com



More information about the stringtemplate-interest mailing list