[stringtemplate-interest] Default Null Option

Rene Villeneuve rvilleneuve at harriscomputer.com
Fri Aug 28 14:40:49 PDT 2009


Hi guys, 

I am not sure if it's the right place to ask my question, but I could
not find a forum anywhere on the site. 

I just started to use string template and while I was able to get
everything set up and working, I hit a little snag earlier today. In
essence, all I'm trying to do is to ensure that every time there is a
null value, instead of skipping it will format correctly with an empty
value. While I can do it through the template, I want to do it
programmatically to ensure that it's always there, as I am not the only
one developing templates. I got it working by creating an anonymous
class, extending StringTemplate, that got an overridden parseAction in
which I modified the list of option coming from parse.action by adding
null every time. 

I also had to modify the way the parser was working to make sure it
would spawn sub template with the valid overwritten parseAction method.
Now it's working, but I am sure I am not using the right method. There
must be a simpler way to add a default option that will be applied to
every element in the template, I just cannot find it. Any form of help
would be appreciated.

Thanks!

Rene Villeneuve


--------------------------------------------------------------------------
Rene Villeneuve
Software Engineer II
 
P: 613-226-5511 ext 2106
F: 
E: rvilleneuve at harriscomputer.com
http://www.harriscomputer.com/ 
 1 Antares Drive, Suite 400
Ottawa, ON
K2E 8C4
http://www.harrisnorthstar.com
 
Join us for our 2009 Customer Conference in Nashville, TN, October 21 - 23!

This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20090828/56ec00b8/attachment.html 


More information about the stringtemplate-interest mailing list