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
String
of the target's binary class name. - A
int
with value0
for an enter advice and {code 1} for an exist advice. - A
Class
representing the class implementing the instrumented method. - A
String
with the name of the instrumented method. - A
java.lang.invoke.MethodHandle
representing the instrumented method unless the target is the type's static initializer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
A 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.InDefinedShape
The advice method.private final boolean
true
if the advice is applied as exit advice. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForDefaultValues
(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 exittrue
if the advice is applied as exit advice.
-
-
Constructor Details
-
ForDefaultValues
Creates a bootstrap argument resolver with default values.- Parameters:
adviceMethod
- The advice method.exit
-true
if 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:
resolve
in interfaceAdvice.BootstrapArgumentResolver
- Parameters:
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.- Returns:
- A list of constants to supply as arguments to the bootstrap method.
-