Package net.bytebuddy.description.method
Class ParameterList.ForLoadedExecutable.Dispatcher.ForJava8CapableVm
- java.lang.Object
-
- net.bytebuddy.description.method.ParameterList.ForLoadedExecutable.Dispatcher.ForJava8CapableVm
-
- All Implemented Interfaces:
ParameterList.ForLoadedExecutable.Dispatcher
- Enclosing interface:
- ParameterList.ForLoadedExecutable.Dispatcher
@Enhance public static class ParameterList.ForLoadedExecutable.Dispatcher.ForJava8CapableVm extends java.lang.Object implements ParameterList.ForLoadedExecutable.Dispatcher
A dispatcher for a legacy VM that does support thejava.lang.reflect.Parameter
type.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.method.ParameterList.ForLoadedExecutable.Dispatcher
ParameterList.ForLoadedExecutable.Dispatcher.CreationAction, ParameterList.ForLoadedExecutable.Dispatcher.ForJava8CapableVm, ParameterList.ForLoadedExecutable.Dispatcher.ForLegacyVm
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Method
getParameterCount
Thejava.lang.reflect.Executable#getParameterCount()
method.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.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForJava8CapableVm(java.lang.reflect.Method getParameterCount)
Creates a new dispatcher for a modern VM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParameterList<ParameterDescription.InDefinedShape>
describe(java.lang.reflect.Constructor<?> constructor, ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSource)
Describes aConstructor
's parameters of the given VM.ParameterList<ParameterDescription.InDefinedShape>
describe(java.lang.reflect.Method method, ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSource)
Describes aMethod
's parameters of the given VM.int
getParameterCount(java.lang.Object executable)
Returns the amount of parameters of a given executable..
-
-
-
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.
-
getParameterCount
private final java.lang.reflect.Method getParameterCount
Thejava.lang.reflect.Executable#getParameterCount()
method.
-
-
Method Detail
-
getParameterCount
public int getParameterCount(java.lang.Object executable)
Returns the amount of parameters of a given executable..- Specified by:
getParameterCount
in interfaceParameterList.ForLoadedExecutable.Dispatcher
- Parameters:
executable
- The executable for which the amount of parameters should be found.- Returns:
- The amount of parameters of the given executable.
-
describe
public ParameterList<ParameterDescription.InDefinedShape> describe(java.lang.reflect.Constructor<?> constructor, ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSource)
Describes aConstructor
's parameters of the given VM.- Specified by:
describe
in interfaceParameterList.ForLoadedExecutable.Dispatcher
- Parameters:
constructor
- The constructor for which the parameters should be described.parameterAnnotationSource
- The parameter annotation source to query.- Returns:
- A list describing the constructor's parameters.
-
describe
public ParameterList<ParameterDescription.InDefinedShape> describe(java.lang.reflect.Method method, ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSource)
Describes aMethod
's parameters of the given VM.- Specified by:
describe
in interfaceParameterList.ForLoadedExecutable.Dispatcher
- Parameters:
method
- The method for which the parameters should be described.parameterAnnotationSource
- The parameter annotation source to query.- Returns:
- A list describing the method's parameters.
-
-