Thanks all for the replies and the links. Food for thought.
I think this problem boils down to a couple of things:
- detection
- validation
I opted for using javax.annotation.processing and making it an explicit
compile-time assertion.
I guess it would be possible to infer intent from these statements and
inspect them before or after compilation:
Pattern.compile("constant");
URI.create("constant");
In general, think detection is the easier of the two problems.
Validation is tricky. I believe it is possible to have
XPath.compile(String) to use Saxon for XPath 2 support in Java 6 (which
supports XPath 1.)
I'm beginning to suspect that reliable validation would have to be designed
into the individual APIs and exposed to the compiler somehow. In cases
where multiple grammars could apply in the same runtime, I'm not sure how
you would tie that all together.
--
You received this message because you are subscribed to the Google Groups "Java
Posse" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/javaposse?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.