Package net.bytebuddy.asm
Class Advice.BootstrapArgumentResolver.ForDefaultValues
java.lang.Object
net.bytebuddy.asm.Advice.BootstrapArgumentResolver.ForDefaultValues
- All Implemented Interfaces:
Advice.BootstrapArgumentResolver
- Enclosing interface:
Advice.BootstrapArgumentResolver
@Enhance
public static class Advice.BootstrapArgumentResolver.ForDefaultValues
extends Object
implements Advice.BootstrapArgumentResolver
An argument resolver that supplies a default selection of arguments. The explicitly resolved constant values are:
- A
Stringof the target's binary class name. - A
intwith value0for an enter advice and {code 1} for an exist advice. - A
Classrepresenting the class implementing the instrumented method. - A
Stringwith the name of the instrumented method. - A
java.lang.invoke.MethodHandlerepresenting the instrumented method unless the target is the type's static initializer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumA factory for creating aAdvice.BootstrapArgumentResolver.ForDefaultValues.Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.BootstrapArgumentResolver
Advice.BootstrapArgumentResolver.ForDefaultValues -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MethodDescription.InDefinedShapeThe advice method.private final booleantrueif the advice is applied as exit advice. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForDefaultValues(MethodDescription.InDefinedShape adviceMethod, boolean exit) Creates a bootstrap argument resolver with default values. -
Method Summary
Modifier and TypeMethodDescriptionresolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod) Resolves the constants that are provided as arguments to the bootstrap methods.
-
Field Details
-
adviceMethod
The advice method. -
exit
private final boolean exittrueif the advice is applied as exit advice.
-
-
Constructor Details
-
ForDefaultValues
Creates a bootstrap argument resolver with default values.- Parameters:
adviceMethod- The advice method.exit-trueif the advice is applied as exit advice.
-
-
Method Details
-
resolve
public List<JavaConstant> resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod) Resolves the constants that are provided as arguments to the bootstrap methods.- Specified by:
resolvein interfaceAdvice.BootstrapArgumentResolver- Parameters:
instrumentedType- The instrumented type.instrumentedMethod- The instrumented method.- Returns:
- A list of constants to supply as arguments to the bootstrap method.
-