Class MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping

    • Method Detail

      • bind

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind​(java.lang.Class<T> type,
                                                                                                                                           @MaybeNull
                                                                                                                                           java.lang.Object value)
        Binds the supplied annotation to a type constant of the supplied value. Constants can be strings, method handles, method types and any primitive or the value null.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        value - The value to bind to the annotation or null to bind the parameter type's default value.
        Returns:
        A new builder for a delegate that considers the supplied annotation type during binding.
      • bind

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind​(java.lang.Class<T> type,
                                                                                                                                           java.lang.reflect.Field field)
        Binds the supplied annotation to the value of the supplied field. The field must be visible by the instrumented type and must be declared by a super type of the instrumented field.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        field - The field to bind to this annotation.
        Returns:
        A new builder for a delegate that considers the supplied annotation type during binding.
      • bind

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind​(java.lang.Class<T> type,
                                                                                                                                           FieldDescription fieldDescription)
        Binds the supplied annotation to the value of the supplied field. The field must be visible by the instrumented type and must be declared by a super type of the instrumented field. The binding is defined as read-only and applied static typing.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        fieldDescription - The field to bind to this annotation.
        Returns:
        A new builder for a delegate that considers the supplied annotation type during binding.
      • bind

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind​(java.lang.Class<T> type,
                                                                                                                                           java.lang.Class<?> value)
        Binds the supplied annotation to the supplied type constant.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        value - The type constant to bind.
        Returns:
        A new builder for a delegate that considers the supplied annotation type during binding.
      • bind

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind​(java.lang.Class<T> type,
                                                                                                                                           TypeDescription value)
        Binds the supplied annotation to the supplied type constant.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        value - The type constant to bind.
        Returns:
        A new builder for a delegate that considers the supplied annotation type during binding.
      • bind

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind​(java.lang.Class<T> type,
                                                                                                                                           java.lang.Enum<?> value)
        Binds the supplied annotation to the supplied enumeration constant.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        value - The enumeration constant to bind.
        Returns:
        A new builder for a delegate that considers the supplied annotation type during binding.
      • bind

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind​(java.lang.Class<T> type,
                                                                                                                                           EnumerationDescription value)
        Binds the supplied annotation to the supplied enumeration constant.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        value - The enumeration constant to bind.
        Returns:
        A new builder for a delegate that considers the supplied annotation type during binding.
      • bindSerialized

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindSerialized​(java.lang.Class<T> type,
                                                                                                                                                     java.io.Serializable value)
        Binds the supplied annotation to the supplied fixed value.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        value - The value to bind to this annotation.
        Returns:
        A new builder for a delegate that considers the supplied annotation type during binding.
      • bindSerialized

        public <T extends java.lang.annotation.Annotation,​S extends java.io.Serializable> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindSerialized​(java.lang.Class<T> type,
                                                                                                                                                                                          S value,
                                                                                                                                                                                          java.lang.Class<? super S> targetType)
        Binds the supplied annotation to the supplied fixed value.
        Type Parameters:
        T - The annotation type.
        S - The type of the serialized instance.
        Parameters:
        type - The type of the annotation being bound.
        value - The value to bind to this annotation.
        targetType - The type of value as which the instance should be treated.
        Returns:
        A new builder for a delegate that considers the supplied annotation type during binding.
      • bindProperty

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindProperty​(java.lang.Class<T> type,
                                                                                                                                                   java.lang.String property)
        Binds the supplied annotation to the annotation's property of the specified name.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        property - The name of the annotation property to be bound.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bind

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind​(java.lang.Class<T> type,
                                                                                                                                           ConstantValue constant)
        Binds the supplied annotation to the given Java constant.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        constant - The constant value that is bound.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bind

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind​(java.lang.Class<T> type,
                                                                                                                                           StackManipulation stackManipulation,
                                                                                                                                           java.lang.reflect.Type targetType)
        Binds the supplied annotation to the annotation's property of the specified name.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        stackManipulation - The stack manipulation loading the bound value.
        targetType - The type of the loaded value.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bind

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind​(java.lang.Class<T> type,
                                                                                                                                           StackManipulation stackManipulation,
                                                                                                                                           TypeDescription.Generic targetType)
        Binds the supplied annotation to the annotation's property of the specified name.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        stackManipulation - The stack manipulation loading the bound value.
        targetType - The type of the loaded value.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bindLambda

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindLambda​(java.lang.Class<T> type,
                                                                                                                                                 java.lang.reflect.Constructor<?> constructor,
                                                                                                                                                 java.lang.Class<?> functionalInterface)
        Binds the supplied annotation as a lambda expression via the JVM's lambda metafactory.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        constructor - The constructor being bound as the lambda expression's implementation.
        functionalInterface - The functional interface that represents the lambda expression.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bindLambda

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindLambda​(java.lang.Class<T> type,
                                                                                                                                                 java.lang.reflect.Constructor<?> constructor,
                                                                                                                                                 java.lang.Class<?> functionalInterface,
                                                                                                                                                 MethodGraph.Compiler methodGraphCompiler)
        Binds the supplied annotation as a lambda expression via the JVM's lambda metafactory.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        constructor - The constructor being bound as the lambda expression's implementation.
        functionalInterface - The functional interface that represents the lambda expression.
        methodGraphCompiler - The method graph compiler that resolves the functional method of the function interface.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bindLambda

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindLambda​(java.lang.Class<T> type,
                                                                                                                                                 java.lang.reflect.Method method,
                                                                                                                                                 java.lang.Class<?> functionalInterface)
        Binds the supplied annotation as a lambda expression via the JVM's lambda metafactory.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        method - The method being bound as the lambda expression's implementation.
        functionalInterface - The functional interface that represents the lambda expression.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bindLambda

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindLambda​(java.lang.Class<T> type,
                                                                                                                                                 java.lang.reflect.Method method,
                                                                                                                                                 java.lang.Class<?> functionalInterface,
                                                                                                                                                 MethodGraph.Compiler methodGraphCompiler)
        Binds the supplied annotation as a lambda expression via the JVM's lambda metafactory.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        method - The method being bound as the lambda expression's implementation.
        functionalInterface - The functional interface that represents the lambda expression.
        methodGraphCompiler - The method graph compiler that resolves the functional method of the function interface.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bindLambda

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindLambda​(java.lang.Class<T> type,
                                                                                                                                                 MethodDescription.InDefinedShape methodDescription,
                                                                                                                                                 TypeDescription functionalInterface)
        Binds the supplied annotation as a lambda expression via the JVM's lambda metafactory.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        methodDescription - The method or constructor being bound as the lambda expression's implementation.
        functionalInterface - The functional interface that represents the lambda expression.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bindLambda

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindLambda​(java.lang.Class<T> type,
                                                                                                                                                 MethodDescription.InDefinedShape methodDescription,
                                                                                                                                                 TypeDescription functionalInterface,
                                                                                                                                                 MethodGraph.Compiler methodGraphCompiler)
        Binds the supplied annotation as a lambda expression via the JVM's lambda metafactory.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        methodDescription - The method or constuctor being bound as the lambda expression's implementation.
        functionalInterface - The functional interface that represents the lambda expression.
        methodGraphCompiler - The method graph compiler that resolves the functional method of the function interface.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bindDynamic

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindDynamic​(java.lang.Class<T> type,
                                                                                                                                                  java.lang.reflect.Method bootstrapMethod,
                                                                                                                                                  java.lang.Object... constant)
        Binds the supplied annotation to a dynamically bootstrapped value.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        bootstrapMethod - The bootstrap method returning the call site.
        constant - The arguments supplied to the bootstrap method.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bindDynamic

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindDynamic​(java.lang.Class<T> type,
                                                                                                                                                  java.lang.reflect.Method bootstrapMethod,
                                                                                                                                                  java.util.List<?> constants)
        Binds the supplied annotation to a dynamically bootstrapped value.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        bootstrapMethod - The bootstrap method returning the call site.
        constants - The arguments supplied to the bootstrap method.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bindDynamic

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindDynamic​(java.lang.Class<T> type,
                                                                                                                                                  java.lang.reflect.Constructor<?> bootstrapMethod,
                                                                                                                                                  java.lang.Object... constant)
        Binds the supplied annotation to a dynamically bootstrapped value.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        bootstrapMethod - The bootstrap constructor returning the call site.
        constant - The arguments supplied to the bootstrap method.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bindDynamic

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindDynamic​(java.lang.Class<T> type,
                                                                                                                                                  java.lang.reflect.Constructor<?> bootstrapMethod,
                                                                                                                                                  java.util.List<?> constants)
        Binds the supplied annotation to a dynamically bootstrapped value.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        bootstrapMethod - The bootstrap constructor returning the call site.
        constants - The arguments supplied to the bootstrap method.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bindDynamic

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindDynamic​(java.lang.Class<T> type,
                                                                                                                                                  MethodDescription.InDefinedShape bootstrapMethod,
                                                                                                                                                  java.lang.Object... constant)
        Binds the supplied annotation to a dynamically bootstrapped value.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        bootstrapMethod - The bootstrap method or constructor returning the call site.
        constant - The arguments supplied to the bootstrap method.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bindDynamic

        public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindDynamic​(java.lang.Class<T> type,
                                                                                                                                                  MethodDescription.InDefinedShape bootstrapMethod,
                                                                                                                                                  java.util.List<?> constants)
        Binds the supplied annotation to a dynamically bootstrapped value.
        Type Parameters:
        T - The annotation type.
        Parameters:
        type - The type of the annotation being bound.
        bootstrapMethod - The bootstrap method or constructor returning the call site.
        constants - The arguments supplied to the bootstrap method.
        Returns:
        A new builder for a delegate that considers the supplied annotation during binding.
      • bootstrap

        public MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bootstrap​(java.lang.reflect.Constructor<?> constructor)
        Defines the supplied constructor as a dynamic invocation bootstrap target for delegating advice methods. The bootstrap method arguments are:
        • A java.lang.invoke.MethodHandles.Lookup representing the source method.
        • A String representing the constructor's internal name <init>.
        • A java.lang.invoke.MethodType representing the type that is requested for binding.
        • A String representation of the delegate's binary class name.
        • A Class representing the receiver type of the substituted element.
        • A String representing the internal name of the substituted element.
        • A java.lang.invoke.MethodHandle to the substituted element.
        • A Class describing the instrumented type.
        • A String representing the instrumented method or constructor.
        Parameters:
        constructor - The bootstrap constructor.
        Returns:
        A new builder for a delegation within a member substitution that uses the supplied constructor for bootstrapping.
      • bootstrap

        public MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bootstrap​(java.lang.reflect.Method method)
        Defines the supplied method as a dynamic invocation bootstrap target for delegating advice methods. The bootstrap method arguments are:
        • A java.lang.invoke.MethodHandles.Lookup representing the source method.
        • A String representing the method's name.
        • A java.lang.invoke.MethodType representing the type that is requested for binding.
        • A String representation of the delegate's binary class name.
        • A Class representing the receiver type of the substituted element.
        • A String representing the internal name of the substituted element.
        • A java.lang.invoke.MethodHandle to the substituted element.
        • A Class describing the instrumented type.
        • A String representing the instrumented method or constructor.
        Parameters:
        method - The bootstrap method.
        Returns:
        A new builder for a delegation within a member substitution that uses the supplied method for bootstrapping.
      • bootstrap

        public MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bootstrap​(MethodDescription.InDefinedShape bootstrap)
        Defines the supplied method description as a dynamic invocation bootstrap target for delegating advice methods. The bootstrap method arguments are:
        • A java.lang.invoke.MethodHandles.Lookup representing the source method.
        • A String representing the target's internal name.
        • A java.lang.invoke.MethodType representing the type that is requested for binding.
        • A String representation of the delegate's binary class name.
        • A Class representing the receiver type of the substituted element.
        • A String representing the internal name of the substituted element.
        • A java.lang.invoke.MethodHandle to the substituted element.
        • A Class describing the instrumented type.
        • A String representing the instrumented method or constructor.
        • A method handle of the instrumented method or constructor, only if the instrumented method is not a type initializer.
        Parameters:
        bootstrap - The bootstrap method or constructor.
        Returns:
        A new builder for a delegation within a member substitution that uses the supplied method or constructor for bootstrapping.
      • to

        public MemberSubstitution.Substitution.Chain.Step.Factory to​(java.lang.reflect.Constructor<?> constructor)
        Returns a delegating step factory for the supplied constructor.
        Parameters:
        constructor - the constructor to delegate to.
        Returns:
        An appropriate step factory.