Package net.bytebuddy.implementation
Class MethodCall.ArgumentLoader.ForMethodParameter.Factory
java.lang.Object
net.bytebuddy.implementation.MethodCall.ArgumentLoader.ForMethodParameter.Factory
- All Implemented Interfaces:
InstrumentedType.Prepareable
,MethodCall.ArgumentLoader.ArgumentProvider
,MethodCall.ArgumentLoader.Factory
- Enclosing class:
MethodCall.ArgumentLoader.ForMethodParameter
@Enhance
public static class MethodCall.ArgumentLoader.ForMethodParameter.Factory
extends Object
implements MethodCall.ArgumentLoader.Factory, MethodCall.ArgumentLoader.ArgumentProvider
A factory for an argument loader that supplies a method parameter as an argument.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
InstrumentedType.Prepareable.NoOp
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
The index of the parameter to be loaded onto the operand stack. -
Constructor Summary
ConstructorsConstructorDescriptionFactory
(int index) Creates a factory for an argument loader that supplies a method parameter as an argument. -
Method Summary
Modifier and TypeMethodDescriptionmake
(Implementation.Target implementationTarget) Creates an argument provider for the supplied implementation target.prepare
(InstrumentedType instrumentedType) Prepares a given instrumented type.resolve
(MethodDescription instrumentedMethod, MethodDescription invokedMethod) Resolves this provider to an argument loader for each provided argument.
-
Field Details
-
index
private final int indexThe index of the parameter to be loaded onto the operand stack.
-
-
Constructor Details
-
Factory
public Factory(int index) Creates a factory for an argument loader that supplies a method parameter as an argument.- Parameters:
index
- The index of the parameter to supply.
-
-
Method Details
-
prepare
Prepares a given instrumented type.- Specified by:
prepare
in interfaceInstrumentedType.Prepareable
- Parameters:
instrumentedType
- The instrumented type in its current form.- Returns:
- The prepared instrumented type.
-
make
Creates an argument provider for the supplied implementation target.- Specified by:
make
in interfaceMethodCall.ArgumentLoader.Factory
- Parameters:
implementationTarget
- The implementation target to use.- Returns:
- An appropriate argument provider.
-
resolve
public List<MethodCall.ArgumentLoader> resolve(MethodDescription instrumentedMethod, MethodDescription invokedMethod) Resolves this provider to an argument loader for each provided argument.- Specified by:
resolve
in interfaceMethodCall.ArgumentLoader.ArgumentProvider
- Parameters:
instrumentedMethod
- The instrumented method.invokedMethod
- The invoked method.- Returns:
- A list of provided argument loaders.
-