Package net.bytebuddy.asm
Class Advice.Delegator.ForRegularInvocation
java.lang.Object
net.bytebuddy.asm.Advice.Delegator.ForRegularInvocation
- All Implemented Interfaces:
Advice.Delegator
- Enclosing interface:
Advice.Delegator
@Enhance
public static class Advice.Delegator.ForRegularInvocation
extends Object
implements Advice.Delegator
Invokes an advice method using a regular method call.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enum
A factory for a regular method invocation delegator.Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.Delegator
Advice.Delegator.ForDynamicInvocation, Advice.Delegator.ForRegularInvocation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MethodDescription.InDefinedShape
The advice method. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForRegularInvocation
(MethodDescription.InDefinedShape adviceMethod) Creates a delegator for a regular invocation. -
Method Summary
Modifier and TypeMethodDescriptionapply
(TypeDescription instrumentedType, MethodDescription instrumentedMethod) Materializes an invocation.void
assertVisibility
(TypeDescription instrumentedType) Asserts the visibility of the delegation target.Returns the advice method's type token.
-
Field Details
-
adviceMethod
The advice method.
-
-
Constructor Details
-
ForRegularInvocation
Creates a delegator for a regular invocation.- Parameters:
adviceMethod
- The advice method.
-
-
Method Details
-
apply
public StackManipulation apply(TypeDescription instrumentedType, MethodDescription instrumentedMethod) Materializes an invocation.- Specified by:
apply
in interfaceAdvice.Delegator
- Parameters:
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.- Returns:
- An appropriate stack manipulation which needs to consume all arguments for the advice method and needs to provide a compatible return type.
-
getTypeToken
Returns the advice method's type token.- Specified by:
getTypeToken
in interfaceAdvice.Delegator
- Returns:
- The advice method's type token.
-
assertVisibility
Asserts the visibility of the delegation target.- Specified by:
assertVisibility
in interfaceAdvice.Delegator
- Parameters:
instrumentedType
- The instrumented type.
-