Class 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 value 0 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.
    • Field Detail

      • 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 interface Advice.BootstrapArgumentResolver
        Parameters:
        instrumentedType - The instrumented type.
        instrumentedMethod - The instrumented method.
        Returns:
        A list of constants to supply as arguments to the bootstrap method.