Like many compiled languages Java has no eval. Consequently the question becomes "What's the best way of evaluating user provided expressions in Java?". There are various answers to this question, but I decided to look into embedding languages in Java.
It's possible to work either through Java 6's generic interface to get at Rhino or through various org.mozilla.* packages to get at Rhino directly . I had some performance issues with the former due to a helper function being unconditionally compiled with each call (more on this in a future post) so I decided to work with Rhino directly.
The result in my JCols utility. If you try it I'd love to hear about it.