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 java.lang.Object implements Advice.Delegator
Invokes an advice method using a regular method call.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Advice.Delegator.ForRegularInvocation.Factory
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
Fields Modifier and Type Field Description private MethodDescription.InDefinedShape
adviceMethod
The advice method.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForRegularInvocation(MethodDescription.InDefinedShape adviceMethod)
Creates a delegator for a regular invocation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StackManipulation
apply(TypeDescription instrumentedType, MethodDescription instrumentedMethod)
Materializes an invocation.void
assertVisibility(TypeDescription instrumentedType)
Asserts the visibility of the delegation target.MethodDescription.TypeToken
getTypeToken()
Returns the advice method's type token.
-
-
-
Field Detail
-
adviceMethod
private final MethodDescription.InDefinedShape adviceMethod
The advice method.
-
-
Constructor Detail
-
ForRegularInvocation
protected ForRegularInvocation(MethodDescription.InDefinedShape adviceMethod)
Creates a delegator for a regular invocation.- Parameters:
adviceMethod
- The advice method.
-
-
Method Detail
-
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
public MethodDescription.TypeToken getTypeToken()
Returns the advice method's type token.- Specified by:
getTypeToken
in interfaceAdvice.Delegator
- Returns:
- The advice method's type token.
-
assertVisibility
public void assertVisibility(TypeDescription instrumentedType)
Asserts the visibility of the delegation target.- Specified by:
assertVisibility
in interfaceAdvice.Delegator
- Parameters:
instrumentedType
- The instrumented type.
-
-