Package net.bytebuddy.utility
Class JavaConstant.MethodHandle.Dispatcher.ForJava7CapableVm
- java.lang.Object
-
- net.bytebuddy.utility.JavaConstant.MethodHandle.Dispatcher.AbstractBase
-
- net.bytebuddy.utility.JavaConstant.MethodHandle.Dispatcher.ForJava7CapableVm
-
- All Implemented Interfaces:
java.security.PrivilegedAction<JavaConstant.MethodHandle.Dispatcher>
,JavaConstant.MethodHandle.Dispatcher
,JavaConstant.MethodHandle.Dispatcher.Initializable
- Enclosing interface:
- JavaConstant.MethodHandle.Dispatcher
@Enhance public static class JavaConstant.MethodHandle.Dispatcher.ForJava7CapableVm extends JavaConstant.MethodHandle.Dispatcher.AbstractBase implements java.security.PrivilegedAction<JavaConstant.MethodHandle.Dispatcher>
A dispatcher that extracts the information of a method handle by using private APIs that are available in Java 7+.
-
-
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.Constructor<?>
methodInfo
A reference to thejava.lang.invoke.MethodInfo
constructor.-
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
ForJava7CapableVm(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.Constructor<?> methodInfo)
Creates a dispatcher for an intermediate 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.JavaConstant.MethodHandle.Dispatcher
run()
-
Methods inherited from class net.bytebuddy.utility.JavaConstant.MethodHandle.Dispatcher.AbstractBase
getDeclaringClass, getMethodType, getName, getReferenceKind, lookupType, parameterArray, publicLookup, returnType
-
-
-
-
Constructor Detail
-
ForJava7CapableVm
protected ForJava7CapableVm(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.Constructor<?> methodInfo)
Creates a dispatcher for an intermediate 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.methodInfo
- A reference to thejava.lang.invoke.MethodInfo
constructor.
-
-
Method Detail
-
initialize
public JavaConstant.MethodHandle.Dispatcher initialize()
Initializes the dispatcher, if required.- Specified by:
initialize
in interfaceJavaConstant.MethodHandle.Dispatcher.Initializable
- Returns:
- The initialized dispatcher.
-
run
public JavaConstant.MethodHandle.Dispatcher run()
- Specified by:
run
in interfacejava.security.PrivilegedAction<JavaConstant.MethodHandle.Dispatcher>
-
reveal
public java.lang.Object reveal(java.lang.Object lookup, java.lang.Object methodHandle)
Reveals a method handle's information object.- Specified by:
reveal
in interfaceJavaConstant.MethodHandle.Dispatcher
- 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.
-
-