Supposedly, method handles are a bit more efficient than using Core reflection. That'll require some proper measuring using JMH.
One challenge will be how to obtain method handles for non-public bean members, e.g. private fields . :
* Java 8 allows to do it via some [reflection trickery|http://stackoverflow.com/questions/19135218/invoke-private-method-with-java-lang-invoke-methodhandle]. * Java 9 provides a new method [MethodHandles#privateLookupIn()|http://download.java.net/java/jdk9/docs/api/index.html?java/lang/invoke/MethodHandles.html] which addresses this. We'd have to provide a way for letting users pass in such look-up. |
|