A Java DSL for binding method handles forward, rather than backward
Java Shell
Failed to load latest commit information.
.mvn/wrapper Add mvn wrapper. Sep 27, 2016
src Export a module for invokebinder. Oct 24, 2017
.travis.yml Try to build with JDK9 on Travis. Oct 24, 2017
LICENSE Add Apache license. Mar 21, 2011
README.markdown Modify signatures in README to be less confusing. Jan 21, 2012
mvnw Add mvn wrapper. Sep 27, 2016
nb-configuration.xml Initial import into git. Mar 21, 2011
nbactions-release-profile.xml Initial import into git. Mar 21, 2011
nbactions.xml Initial import into git. Mar 21, 2011
pom.xml [maven-release-plugin] prepare for next development iteration Nov 9, 2017



This library hopes to provide a more friendly DSL for binding method handles. Unlike the normal MethodHandle API, handles are bound forward from a source MethodType and eventually adapted to a final target MethodHandle. Along the way the transformations are pushed onto a stack and eventually applied in reverse order, as the standard API demands.


Transformation calls can be chained. They are not applied until an eventual "invoke" is called with the target endpoint MethodHandle.

MethodHandle mh = Binder
   .from(String.class, String.class, String.class) // String w(String, String)
   .drop(1, String.class) // String x(String)
   .insert(0, 'hello') // String y(String, String)
   .cast(String.class, CharSequence.class, Object.class) // String z(CharSequence, Object)


This is currently under development. Not all transformations from the MethodHandle API are yet supported.

Contributors are welcome :)