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 java.lang.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 Classes Modifier and Type Class Description static class
Advice.BootstrapArgumentResolver.ForDefaultValues.Factory
A factory for creating aAdvice.BootstrapArgumentResolver.ForDefaultValues
.-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.BootstrapArgumentResolver
Advice.BootstrapArgumentResolver.ForDefaultValues
-
-
Field Summary
Fields Modifier and Type Field Description private MethodDescription.InDefinedShape
adviceMethod
The advice method.private boolean
exit
true
if the advice is applied as exit advice.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForDefaultValues(MethodDescription.InDefinedShape adviceMethod, boolean exit)
Creates a bootstrap argument resolver with default values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<JavaConstant>
resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod)
Resolves the constants that are provided as arguments to the bootstrap methods.
-
-
-
Field Detail
-
adviceMethod
private final MethodDescription.InDefinedShape adviceMethod
The advice method.
-
exit
private final boolean exit
true
if the advice is applied as exit advice.
-
-
Constructor Detail
-
ForDefaultValues
protected ForDefaultValues(MethodDescription.InDefinedShape adviceMethod, boolean exit)
Creates a bootstrap argument resolver with default values.- Parameters:
adviceMethod
- The advice method.exit
-true
if the advice is applied as exit advice.
-
-
Method Detail
-
resolve
public java.util.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.
-
-