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 classAdvice.Delegator.ForRegularInvocation.FactoryA 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.InDefinedShapeadviceMethodThe advice method.
-
Constructor Summary
Constructors Modifier Constructor Description protectedForRegularInvocation(MethodDescription.InDefinedShape adviceMethod)Creates a delegator for a regular invocation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StackManipulationapply(TypeDescription instrumentedType, MethodDescription instrumentedMethod)Materializes an invocation.voidassertVisibility(TypeDescription instrumentedType)Asserts the visibility of the delegation target.MethodDescription.TypeTokengetTypeToken()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:
applyin 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:
getTypeTokenin interfaceAdvice.Delegator- Returns:
- The advice method's type token.
-
assertVisibility
public void assertVisibility(TypeDescription instrumentedType)
Asserts the visibility of the delegation target.- Specified by:
assertVisibilityin interfaceAdvice.Delegator- Parameters:
instrumentedType- The instrumented type.
-
-