Package net.bytebuddy.implementation
Class MethodCall.TargetHandler.Simple
- java.lang.Object
-
- net.bytebuddy.implementation.MethodCall.TargetHandler.Simple
-
- All Implemented Interfaces:
InstrumentedType.Prepareable
,MethodCall.TargetHandler
,MethodCall.TargetHandler.Factory
,MethodCall.TargetHandler.Resolved
- Enclosing interface:
- MethodCall.TargetHandler
@Enhance public static class MethodCall.TargetHandler.Simple extends java.lang.Object implements MethodCall.TargetHandler, MethodCall.TargetHandler.Factory, MethodCall.TargetHandler.Resolved
A simple target handler that applies a given stack manipulation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.MethodCall.TargetHandler
MethodCall.TargetHandler.Factory, MethodCall.TargetHandler.ForConstructingInvocation, MethodCall.TargetHandler.ForField, MethodCall.TargetHandler.ForMethodCall, MethodCall.TargetHandler.ForMethodParameter, MethodCall.TargetHandler.ForSelfOrStaticInvocation, MethodCall.TargetHandler.ForValue, MethodCall.TargetHandler.Resolved, MethodCall.TargetHandler.Simple
-
-
Field Summary
Fields Modifier and Type Field Description private StackManipulation
stackManipulation
The stack manipulation that loads a target for the method call.private TypeDescription
typeDescription
The type resolved by the stack manipulation.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Simple(TypeDescription typeDescription, StackManipulation stackManipulation)
Creates a simple target handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeDescription
getTypeDescription()
Returns the target's type description.MethodCall.TargetHandler
make(Implementation.Target implementationTarget)
Creates a target handler for a given implementation target.InstrumentedType
prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.MethodCall.TargetHandler.Resolved
resolve(MethodDescription instrumentedMethod)
Resolves this target handler.StackManipulation
toStackManipulation(MethodDescription invokedMethod, Assigner assigner, Assigner.Typing typing)
Creates a stack manipulation to represent this resolved target handler.
-
-
-
Field Detail
-
typeDescription
private final TypeDescription typeDescription
The type resolved by the stack manipulation.
-
stackManipulation
private final StackManipulation stackManipulation
The stack manipulation that loads a target for the method call.
-
-
Constructor Detail
-
Simple
protected Simple(TypeDescription typeDescription, StackManipulation stackManipulation)
Creates a simple target handler.- Parameters:
typeDescription
- The type resolved by the stack manipulation.stackManipulation
- The stack manipulation that loads a target for the method call.
-
-
Method Detail
-
make
public MethodCall.TargetHandler make(Implementation.Target implementationTarget)
Creates a target handler for a given implementation target.- Specified by:
make
in interfaceMethodCall.TargetHandler.Factory
- Parameters:
implementationTarget
- The implementation target to use.- Returns:
- The target handler to use.
-
prepare
public InstrumentedType prepare(InstrumentedType instrumentedType)
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.
-
resolve
public MethodCall.TargetHandler.Resolved resolve(MethodDescription instrumentedMethod)
Resolves this target handler.- Specified by:
resolve
in interfaceMethodCall.TargetHandler
- Parameters:
instrumentedMethod
- The instrumented method.- Returns:
- The resolved target handler.
-
getTypeDescription
public TypeDescription getTypeDescription()
Returns the target's type description.- Specified by:
getTypeDescription
in interfaceMethodCall.TargetHandler.Resolved
- Returns:
- The target's type description.
-
toStackManipulation
public StackManipulation toStackManipulation(MethodDescription invokedMethod, Assigner assigner, Assigner.Typing typing)
Creates a stack manipulation to represent this resolved target handler.- Specified by:
toStackManipulation
in interfaceMethodCall.TargetHandler.Resolved
- Parameters:
invokedMethod
- The invoked method.assigner
- The assigner to use.typing
- The typing to apply.- Returns:
- A stack manipulation that implements this target handler.
-
-