[stringtemplate-interest] v4 model adaptor unit tests
Rafael Chaves
rafael at alphasimple.com
Thu Dec 23 17:45:41 PST 2010
It seems the way an adaptor passes up the opportunity to address a
property is by throwing an exception. Is that correct, or does the
exception signals a real error and aborts property resolution? It was
not clear from the test cases as both adaptors handle the exact same
properties.
If that is correct, doesn't throwing exceptions for the majority of
properties being resolved (which in the normal case would be handled
by the default ObjectModelAdaptor) create a lot of unnecessary
objects?
I handled the case of not understanding a property by returning null,
but that does not allow actually returning null as the intended value.
Could be returning some other object (a DOES_NOT_UNDERSTAND string
constant, for instance) instead.
Cheers,
Rafael
On Thu, Dec 23, 2010 at 5:24 PM, Terence Parr <parrt at cs.usfca.edu> wrote:
> http://www.stringtemplate.org/depot/ST4/java/main/test/org/stringtemplate/v4/test/TestModelAdaptors.java
> in case you want to look. (374 tests overall)
> Ter
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>
>
More information about the stringtemplate-interest
mailing list