Package net.bytebuddy.implementation
Class MethodCall.ArgumentLoader.ForThisReference
- java.lang.Object
-
- net.bytebuddy.implementation.MethodCall.ArgumentLoader.ForThisReference
-
- All Implemented Interfaces:
MethodCall.ArgumentLoader
,MethodCall.ArgumentLoader.ArgumentProvider
- Enclosing interface:
- MethodCall.ArgumentLoader
@Enhance public static class MethodCall.ArgumentLoader.ForThisReference extends Object implements MethodCall.ArgumentLoader, MethodCall.ArgumentLoader.ArgumentProvider
An argument loader that assigns thethis
reference to a parameter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MethodCall.ArgumentLoader.ForThisReference.Factory
A factory for an argument loader that supplies thethis
value as an argument.-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.MethodCall.ArgumentLoader
MethodCall.ArgumentLoader.ArgumentProvider, MethodCall.ArgumentLoader.ForField, MethodCall.ArgumentLoader.ForInstance, MethodCall.ArgumentLoader.ForInstrumentedType, MethodCall.ArgumentLoader.ForMethodCall, MethodCall.ArgumentLoader.ForMethodParameter, MethodCall.ArgumentLoader.ForMethodParameterArray, MethodCall.ArgumentLoader.ForMethodParameterArrayElement, MethodCall.ArgumentLoader.ForNullConstant, MethodCall.ArgumentLoader.ForStackManipulation, MethodCall.ArgumentLoader.ForThisReference
-
-
Constructor Summary
Constructors Constructor Description ForThisReference(TypeDescription instrumentedType)
Creates an argument loader that supplies thethis
instance as an argument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<MethodCall.ArgumentLoader>
resolve(MethodDescription instrumentedMethod, MethodDescription invokedMethod)
Resolves this provider to an argument loader for each provided argument.StackManipulation
toStackManipulation(ParameterDescription target, Assigner assigner, Assigner.Typing typing)
Loads the argument that is represented by this instance onto the operand stack.
-
-
-
Constructor Detail
-
ForThisReference
public ForThisReference(TypeDescription instrumentedType)
Creates an argument loader that supplies thethis
instance as an argument.- Parameters:
instrumentedType
- The instrumented type.
-
-
Method Detail
-
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.
-
toStackManipulation
public StackManipulation toStackManipulation(ParameterDescription target, Assigner assigner, Assigner.Typing typing)
Loads the argument that is represented by this instance onto the operand stack.- Specified by:
toStackManipulation
in interfaceMethodCall.ArgumentLoader
- Parameters:
target
- The target parameter.assigner
- The assigner to be used.typing
- Indicates if dynamic type castings should be attempted for incompatible assignments.- Returns:
- The stack manipulation that loads the represented argument onto the stack.
-
-