Home » openjdk-7 » java.lang.invoke » [javadoc | source]
java.lang.invoke
class: ToGeneric [javadoc | source]
java.lang.Object
   java.lang.invoke.ToGeneric
Adapters which mediate between incoming calls which are not generic and outgoing calls which are. Any call can be represented generically boxing up its arguments, and (on return) unboxing the return value.

A call is "generic" (in MethodHandle terms) if its MethodType features only Object arguments. A non-generic call therefore features primitives and/or reference types other than Object. An adapter has types for its incoming and outgoing calls. The incoming call type is simply determined by the adapter's type (the MethodType it presents to callers). The outgoing call type is determined by the adapter's target (a MethodHandle that the adapter either binds internally or else takes as a leading argument). (To stretch the term, adapter-like method handles may have multiple targets or be polymorphic across multiple call types.)

Nested Class Summary:
abstract static class  ToGeneric.Adapter  The invoke method takes some particular but unconstrained spread of raw argument types, and returns a raw return type (in L/I/J/F/D). Internally, it converts the incoming arguments uniformly into objects. This series of objects is then passed to the {@code target} method, which returns a result object. This result is finally converted, via another method handle {@code convert}, which is responsible for converting the object result into the raw return value. 
static class  ToGeneric.A0   
static class  ToGeneric.A1   
static class  ToGeneric.A2   
static class  ToGeneric.A3   
static class  ToGeneric.A4   
static class  ToGeneric.A5   
static class  ToGeneric.A6   
static class  ToGeneric.A7   
static class  ToGeneric.A8   
static class  ToGeneric.A9   
static class  ToGeneric.A10   
Method from java.lang.invoke.ToGeneric Summary:
buildAdapterFromBytecodes,   debugString,   findAdapter,   make,   makeInstance,   makeRawArgumentFilter,   of
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.lang.invoke.ToGeneric Detail:
 static Adapter buildAdapterFromBytecodes(MethodType entryPointType) 
 String debugString() 
 static Adapter findAdapter(MethodType entryPointType) 
 public static MethodHandle make(MethodType type,
    MethodHandle genericTarget) 
    Build an adapter of the given type, which invokes genericTarget on the incoming arguments, after boxing as necessary. The return value is unboxed if necessary.
 Adapter makeInstance(MethodType type,
    MethodHandle genericTarget) 
 static MethodHandle makeRawArgumentFilter(MethodHandle invoker,
    MethodType raw,
    MethodType cooked) 
    A generic argument list will be created by a call of type 'raw'. The values need to be reboxed for to match 'cooked'. Do this on the fly.
 static ToGeneric of(MethodType type) 
    Return the adapter information for this type's erasure.