title: Is there a general "back-end" library for Java reflection
body: <p>I'm currently working with a specialized, interpreted, programming language implemented in Java. As a very small part of the language, I'd like to add the ability to make calls into Java.  Before I dive into all of the nitty-gritty of reflection, I was wondering if anyone knew of a general library for doing the &quot;back-end&quot; part of invoking Java code reflectively.</p>
  <p>That is, I parse a string (I define the grammar) into some data structure that represents a Java method call (or constructor, or field access) and then pass that data structure to this library that invokes the call and returns the result. In particular, I'd like it to already handle all the edge cases that I don't want to figure out:</p>
  <ul>
  <li>Automagically pick the right method based on the types of arguments (like an intelligent Class.getDeclaredMethod())</li>
  <li>Handle distinction between arrays and normal object references</li>
  <li>etc</li>
  </ul>
  <p>I've spent a little time looking at the implementations of dynamic languages on the JVM, but these are generally much more complicated than I'm looking for, or highly optimized for the particular language.</p>
  <p>Another option is to convert my grammar into a string in some dynamic language and invoke it with Rhino or something, but that's a little more overhead than I'm looking for.</p>