Package net.bytebuddy.utility
Class JavaConstant.MethodHandle.Dispatcher.AbstractBase
- java.lang.Object
-
- net.bytebuddy.utility.JavaConstant.MethodHandle.Dispatcher.AbstractBase
-
- All Implemented Interfaces:
JavaConstant.MethodHandle.Dispatcher
,JavaConstant.MethodHandle.Dispatcher.Initializable
- Direct Known Subclasses:
JavaConstant.MethodHandle.Dispatcher.ForJava7CapableVm
,JavaConstant.MethodHandle.Dispatcher.ForJava8CapableVm
- Enclosing interface:
- JavaConstant.MethodHandle.Dispatcher
@Enhance public abstract static class JavaConstant.MethodHandle.Dispatcher.AbstractBase extends Object implements JavaConstant.MethodHandle.Dispatcher, JavaConstant.MethodHandle.Dispatcher.Initializable
An abstract base implementation of a dispatcher.
-
-
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 protected Method
getDeclaringClass
A reference tojava.lang.invoke.MethodHandleInfo#getDeclaringClass
.protected Method
getMethodType
A reference tojava.lang.invoke.MethodHandleInfo#getMethodType
.protected Method
getName
A reference tojava.lang.invoke.MethodHandleInfo#getName
.protected Method
getReferenceKind
A reference tojava.lang.invoke.MethodHandleInfo#getReferenceKind
.protected Method
lookupClass
A reference tojava.lang.invoke.MethodHandles$Lookup#lookupClass
method.protected Method
parameterArray
A reference tojava.lang.invoke.MethodType#parameterArray
.protected Method
publicLookup
A reference tojava.lang.invoke.MethodHandles#publicLookup
.protected Method
returnType
A reference tojava.lang.invoke.MethodType#returnType
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>
getDeclaringClass(Object methodHandleInfo)
Returns the declaring class of the supplied method handle info.Object
getMethodType(Object methodHandleInfo)
Returns a method handle info's method type.String
getName(Object methodHandleInfo)
Returns the method name of the supplied method handle info.int
getReferenceKind(Object methodHandleInfo)
Returns the reference kind of the supplied method handle info.Class<?>
lookupType(Object lookup)
Returns the lookup type of a givenjava.lang.invoke.MethodHandles$Lookup
instance.List<? extends Class<?>>
parameterArray(Object methodType)
Returns the parameter types of the supplied method type.Object
publicLookup()
Returns a publicjava.lang.invoke.MethodHandles.Lookup
instance.Class<?>
returnType(Object methodType)
Returns the return type of the supplied method type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.bytebuddy.utility.JavaConstant.MethodHandle.Dispatcher
reveal
-
Methods inherited from interface net.bytebuddy.utility.JavaConstant.MethodHandle.Dispatcher.Initializable
initialize
-
-
-
-
Field Detail
-
publicLookup
protected final Method publicLookup
A reference tojava.lang.invoke.MethodHandles#publicLookup
.
-
getName
protected final Method getName
A reference tojava.lang.invoke.MethodHandleInfo#getName
.
-
getDeclaringClass
protected final Method getDeclaringClass
A reference tojava.lang.invoke.MethodHandleInfo#getDeclaringClass
.
-
getReferenceKind
protected final Method getReferenceKind
A reference tojava.lang.invoke.MethodHandleInfo#getReferenceKind
.
-
getMethodType
protected final Method getMethodType
A reference tojava.lang.invoke.MethodHandleInfo#getMethodType
.
-
returnType
protected final Method returnType
A reference tojava.lang.invoke.MethodType#returnType
.
-
parameterArray
protected final Method parameterArray
A reference tojava.lang.invoke.MethodType#parameterArray
.
-
lookupClass
protected final Method lookupClass
A reference tojava.lang.invoke.MethodHandles$Lookup#lookupClass
method.
-
-
Constructor Detail
-
AbstractBase
protected AbstractBase(Method publicLookup, Method getName, Method getDeclaringClass, Method getReferenceKind, Method getMethodType, Method returnType, Method parameterArray, Method lookupClass)
Creates a legal dispatcher.- 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.
-
-
Method Detail
-
publicLookup
public Object publicLookup()
Returns a publicjava.lang.invoke.MethodHandles.Lookup
instance.- Specified by:
publicLookup
in interfaceJavaConstant.MethodHandle.Dispatcher.Initializable
- Returns:
- A public
java.lang.invoke.MethodHandles.Lookup
instance.
-
getMethodType
public Object getMethodType(Object methodHandleInfo)
Returns a method handle info's method type.- Specified by:
getMethodType
in interfaceJavaConstant.MethodHandle.Dispatcher
- Parameters:
methodHandleInfo
- The method handle info to introspect.- Returns:
- The
java.lang.invoke.MethodType
instance representing the method handle's type.
-
getReferenceKind
public int getReferenceKind(Object methodHandleInfo)
Returns the reference kind of the supplied method handle info.- Specified by:
getReferenceKind
in interfaceJavaConstant.MethodHandle.Dispatcher
- Parameters:
methodHandleInfo
- The method handle to be introspected.- Returns:
- The method handle info's reference type.
-
getDeclaringClass
public Class<?> getDeclaringClass(Object methodHandleInfo)
Returns the declaring class of the supplied method handle info.- Specified by:
getDeclaringClass
in interfaceJavaConstant.MethodHandle.Dispatcher
- Parameters:
methodHandleInfo
- The method handle to be introspected.- Returns:
- The method handle info's declaring class.
-
getName
public String getName(Object methodHandleInfo)
Returns the method name of the supplied method handle info.- Specified by:
getName
in interfaceJavaConstant.MethodHandle.Dispatcher
- Parameters:
methodHandleInfo
- The method handle to be introspected.- Returns:
- The method handle info's method name.
-
returnType
public Class<?> returnType(Object methodType)
Returns the return type of the supplied method type.- Specified by:
returnType
in interfaceJavaConstant.MethodHandle.Dispatcher
- Parameters:
methodType
- The method type to be introspected.- Returns:
- The method type's return type.
-
parameterArray
public List<? extends Class<?>> parameterArray(Object methodType)
Returns the parameter types of the supplied method type.- Specified by:
parameterArray
in interfaceJavaConstant.MethodHandle.Dispatcher
- Parameters:
methodType
- The method type to be introspected.- Returns:
- The method type's parameter types.
-
lookupType
public Class<?> lookupType(Object lookup)
Returns the lookup type of a givenjava.lang.invoke.MethodHandles$Lookup
instance.- Specified by:
lookupType
in interfaceJavaConstant.MethodHandle.Dispatcher.Initializable
- Parameters:
lookup
- Ajava.lang.invoke.MethodHandles$Lookup
instance.- Returns:
- The provided instance's lookup type.
-
-