Package net.bytebuddy.utility
Class JavaConstant.MethodHandle.Dispatcher.ForJava8CapableVm
- java.lang.Object
-
- net.bytebuddy.utility.JavaConstant.MethodHandle.Dispatcher.AbstractBase
-
- net.bytebuddy.utility.JavaConstant.MethodHandle.Dispatcher.ForJava8CapableVm
-
- All Implemented Interfaces:
JavaConstant.MethodHandle.Dispatcher
,JavaConstant.MethodHandle.Dispatcher.Initializable
- Enclosing interface:
- JavaConstant.MethodHandle.Dispatcher
@Enhance public static class JavaConstant.MethodHandle.Dispatcher.ForJava8CapableVm extends JavaConstant.MethodHandle.Dispatcher.AbstractBase
A dispatcher for introspecting ajava.lang.invoke.MethodHandle
instance on a virtual machine that officially supports this introspection, i.e. Java versions 8+.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.utility.JavaConstant.MethodHandle.Dispatcher
JavaConstant.MethodHandle.Dispatcher.AbstractBase, JavaConstant.MethodHandle.Dispatcher.CreationAction, JavaConstant.MethodHandle.Dispatcher.ForJava7CapableVm, JavaConstant.MethodHandle.Dispatcher.ForJava8CapableVm, JavaConstant.MethodHandle.Dispatcher.ForLegacyVm, JavaConstant.MethodHandle.Dispatcher.Initializable
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Method
revealDirect
A reference to thejava.lang.invoke.MethodHandles.Lookup#revealDirect
method.-
Fields inherited from class net.bytebuddy.utility.JavaConstant.MethodHandle.Dispatcher.AbstractBase
getDeclaringClass, getMethodType, getName, getReferenceKind, lookupClass, parameterArray, publicLookup, returnType
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForJava8CapableVm(java.lang.reflect.Method publicLookup, java.lang.reflect.Method getName, java.lang.reflect.Method getDeclaringClass, java.lang.reflect.Method getReferenceKind, java.lang.reflect.Method getMethodType, java.lang.reflect.Method returnType, java.lang.reflect.Method parameterArray, java.lang.reflect.Method lookupClass, java.lang.reflect.Method revealDirect)
Creates a dispatcher for a modern VM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaConstant.MethodHandle.Dispatcher
initialize()
Initializes the dispatcher, if required.java.lang.Object
reveal(java.lang.Object lookup, java.lang.Object methodHandle)
Reveals a method handle's information object.-
Methods inherited from class net.bytebuddy.utility.JavaConstant.MethodHandle.Dispatcher.AbstractBase
getDeclaringClass, getMethodType, getName, getReferenceKind, lookupType, parameterArray, publicLookup, returnType
-
-
-
-
Constructor Detail
-
ForJava8CapableVm
protected ForJava8CapableVm(java.lang.reflect.Method publicLookup, java.lang.reflect.Method getName, java.lang.reflect.Method getDeclaringClass, java.lang.reflect.Method getReferenceKind, java.lang.reflect.Method getMethodType, java.lang.reflect.Method returnType, java.lang.reflect.Method parameterArray, java.lang.reflect.Method lookupClass, java.lang.reflect.Method revealDirect)
Creates a dispatcher for a modern VM.- Parameters:
publicLookup
- A reference tojava.lang.invoke.MethodHandles#publicLookup
.getName
- A reference tojava.lang.invoke.MethodHandleInfo#getName
.getDeclaringClass
- A reference tojava.lang.invoke.MethodHandleInfo#getDeclaringClass
.getReferenceKind
- A reference tojava.lang.invoke.MethodHandleInfo#getReferenceKind
.getMethodType
- A reference tojava.lang.invoke.MethodHandleInfo#getMethodType
.returnType
- A reference tojava.lang.invoke.MethodType#returnType
.parameterArray
- A reference tojava.lang.invoke.MethodType#parameterArray
.lookupClass
- A reference tojava.lang.invoke.MethodHandles$Lookup#lookupClass
method.revealDirect
- A reference to thejava.lang.invoke.MethodHandles.Lookup#revealDirect
method.
-
-
Method Detail
-
reveal
public java.lang.Object reveal(java.lang.Object lookup, java.lang.Object methodHandle)
Reveals a method handle's information object.- Parameters:
lookup
- The lookup to be used for introspecting the instance.methodHandle
- The method handle to be introspected.- Returns:
- The
java.lang.invoke.MethodHandleInfo
object that describes the instance.
-
initialize
public JavaConstant.MethodHandle.Dispatcher initialize()
Initializes the dispatcher, if required.- Returns:
- The initialized dispatcher.
-
-