Slide 2
Slide 2 text
Method Handle
A Method Handle (MH) is a typed, directly executable
reference to an underlying method, field, constructor, or
similar low level operation, with optional transformations of
arguments and return values1.
MethodHandle g = lookup () . f i n d V i r t u a l ( S t r i n g .class, ” isEmpty ” , methodType (
boolean.class) ) ;
MethodHandle gwt = MethodHandles . guardWithTest (g , t , f ) ;
MethodType: argument types and return type.
Executable reference.
Method Type Transformation. e.g., GuardWithTest,
CatchException, FilterReturn.
1
https://docs.oracle.com/javase/7/docs/api/java/lang/invoke/MethodHandle.html