[stringtemplate-interest] Fail on undefined property
Felix Dorner
felix_do at web.de
Fri Jul 31 12:58:37 PDT 2009
>
>> What I did is to subclass Properties so that it throws a runtime
>> exception upon its get() method on undefined properties. However, I
>> see that you also make use of containsKey(), so I'd need to override
>> that too, and I'm starting to feel that my approach is probably not
>> the right way to go. Isn't there an option that tells StringTemplate
>> to fail if an attribute is not defined?
>
> Is this these C# version?
>
Nope, Java.
> You could override StringTemplate an alter its get attribute method.
> T
I've seen there's StringTemplateErrorListener and getWarning(). Would a
warning be issued on an empty attribute? I could then set a flag and
'define' the run as failed afterwards..
More information about the stringtemplate-interest
mailing list