Package net.bytebuddy.utility
Class JavaConstant.MethodType.Dispatcher.ForJava7CapableVm
- java.lang.Object
-
- net.bytebuddy.utility.JavaConstant.MethodType.Dispatcher.ForJava7CapableVm
-
- All Implemented Interfaces:
JavaConstant.MethodType.Dispatcher
- Enclosing interface:
- JavaConstant.MethodType.Dispatcher
@Enhance public static class JavaConstant.MethodType.Dispatcher.ForJava7CapableVm extends java.lang.Object implements JavaConstant.MethodType.Dispatcher
A dispatcher for virtual machines that are aware of thejava.lang.invoke.MethodType
type that was added in Java version 7.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.utility.JavaConstant.MethodType.Dispatcher
JavaConstant.MethodType.Dispatcher.CreationAction, JavaConstant.MethodType.Dispatcher.ForJava7CapableVm, JavaConstant.MethodType.Dispatcher.ForLegacyVm
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.Object[]
NO_ARGUMENTS
An empty array that can be used to indicate no arguments to avoid an allocation on a reflective call.private java.lang.reflect.Method
parameterArray
A reference tojava.lang.invoke.MethodType#returnType
.private java.lang.reflect.Method
returnType
A reference tojava.lang.invoke.MethodType#returnType
.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForJava7CapableVm(java.lang.reflect.Method returnType, java.lang.reflect.Method parameterArray)
Creates a new dispatcher for a modern JVM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>[]
parameterArray(java.lang.Object methodType)
Extracts the parameter types of the supplied method type.java.lang.Class<?>
returnType(java.lang.Object methodType)
Extracts the return type of the supplied method type.
-
-
-
Field Detail
-
NO_ARGUMENTS
private static final java.lang.Object[] NO_ARGUMENTS
An empty array that can be used to indicate no arguments to avoid an allocation on a reflective call.
-
returnType
private final java.lang.reflect.Method returnType
A reference tojava.lang.invoke.MethodType#returnType
.
-
parameterArray
private final java.lang.reflect.Method parameterArray
A reference tojava.lang.invoke.MethodType#returnType
.
-
-
Constructor Detail
-
ForJava7CapableVm
protected ForJava7CapableVm(java.lang.reflect.Method returnType, java.lang.reflect.Method parameterArray)
Creates a new dispatcher for a modern JVM.- Parameters:
returnType
- A reference tojava.lang.invoke.MethodType#returnType
.parameterArray
- A reference tojava.lang.invoke.MethodType#returnType
.
-
-
Method Detail
-
returnType
public java.lang.Class<?> returnType(java.lang.Object methodType)
Extracts the return type of the supplied method type.- Specified by:
returnType
in interfaceJavaConstant.MethodType.Dispatcher
- Parameters:
methodType
- An instance ofjava.lang.invoke.MethodType
.- Returns:
- The return type that is described by the supplied instance.
-
parameterArray
public java.lang.Class<?>[] parameterArray(java.lang.Object methodType)
Extracts the parameter types of the supplied method type.- Specified by:
parameterArray
in interfaceJavaConstant.MethodType.Dispatcher
- Parameters:
methodType
- An instance ofjava.lang.invoke.MethodType
.- Returns:
- The parameter types that are described by the supplied instance.
-
-