Package net.bytebuddy.asm
Class MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping
- Enclosing class:
MemberSubstitution.Substitution.Chain.Step.ForDelegation
public static class MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping
extends Object
A factory for a
MemberSubstitution.Substitution.Chain.Step.ForDelegation which allows for a custom configuration.-
Field Summary
FieldsModifier and TypeFieldDescriptionThe dispatcher factory to use.private final Map<Class<? extends Annotation>, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<?>> A mapping of offset mapping factories by their respective annotation type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWithCustomMapping(MemberSubstitution.Substitution.Chain.Step.ForDelegation.Dispatcher.Factory dispatcherFactory, Map<Class<? extends Annotation>, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<?>> offsetMappings) Creates a factory for aMemberSubstitution.Substitution.Chain.Step.ForDelegationwith a custom value. -
Method Summary
Modifier and TypeMethodDescriptionBinds the supplied annotation to the supplied type constant.Binds the supplied annotation to the supplied enumeration constant.Binds the supplied annotation to a type constant of the supplied value.Binds the supplied annotation to the value of the supplied field.bind(Class<T> type, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping offsetMapping) Binds the supplied annotation to the annotation's property of the specified name.bind(Class<T> type, EnumerationDescription value) Binds the supplied annotation to the supplied enumeration constant.bind(Class<T> type, FieldDescription fieldDescription) Binds the supplied annotation to the value of the supplied field.bind(Class<T> type, TypeDescription value) Binds the supplied annotation to the supplied type constant.bind(Class<T> type, StackManipulation stackManipulation, Type targetType) Binds the supplied annotation to the annotation's property of the specified name.bind(Class<T> type, StackManipulation stackManipulation, TypeDescription.Generic targetType) Binds the supplied annotation to the annotation's property of the specified name.bind(Class<T> type, ConstantValue constant) Binds the supplied annotation to the given Java constant.bind(MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<?> offsetMapping) Binds an annotation to a dynamically computed value.bindDynamic(Class<T> type, Constructor<?> bootstrapMethod, Object... constant) Binds the supplied annotation to a dynamically bootstrapped value.bindDynamic(Class<T> type, Constructor<?> bootstrapMethod, List<?> constants) Binds the supplied annotation to a dynamically bootstrapped value.bindDynamic(Class<T> type, Method bootstrapMethod, Object... constant) Binds the supplied annotation to a dynamically bootstrapped value.bindDynamic(Class<T> type, Method bootstrapMethod, List<?> constants) Binds the supplied annotation to a dynamically bootstrapped value.bindDynamic(Class<T> type, MethodDescription.InDefinedShape bootstrapMethod, Object... constant) Binds the supplied annotation to a dynamically bootstrapped value.bindDynamic(Class<T> type, MethodDescription.InDefinedShape bootstrapMethod, List<?> constants) Binds the supplied annotation to a dynamically bootstrapped value.bindLambda(Class<T> type, Constructor<?> constructor, Class<?> functionalInterface) Binds the supplied annotation as a lambda expression via the JVM's lambda metafactory.bindLambda(Class<T> type, Constructor<?> constructor, Class<?> functionalInterface, MethodGraph.Compiler methodGraphCompiler) Binds the supplied annotation as a lambda expression via the JVM's lambda metafactory.bindLambda(Class<T> type, Method method, Class<?> functionalInterface) Binds the supplied annotation as a lambda expression via the JVM's lambda metafactory.bindLambda(Class<T> type, Method method, Class<?> functionalInterface, MethodGraph.Compiler methodGraphCompiler) Binds the supplied annotation as a lambda expression via the JVM's lambda metafactory.bindLambda(Class<T> type, MethodDescription.InDefinedShape methodDescription, TypeDescription functionalInterface) Binds the supplied annotation as a lambda expression via the JVM's lambda metafactory.bindLambda(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.bindProperty(Class<T> type, String property) Binds the supplied annotation to the annotation's property of the specified name.bindSerialized(Class<T> type, Serializable value) Binds the supplied annotation to the supplied fixed value.<T extends Annotation,S extends Serializable>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindSerialized(Class<T> type, S value, Class<? super S> targetType) Binds the supplied annotation to the supplied fixed value.bootstrap(Constructor<?> constructor) Defines the supplied constructor as a dynamic invocation bootstrap target for delegating advice methods.bootstrap(Constructor<?> constructor, MemberSubstitution.Substitution.Chain.Step.ForDelegation.BootstrapArgumentResolver.Factory resolverFactory) Defines the supplied constructor as a dynamic invocation bootstrap target for delegating advice methods.Defines the supplied method as a dynamic invocation bootstrap target for delegating advice methods.bootstrap(Method method, MemberSubstitution.Substitution.Chain.Step.ForDelegation.BootstrapArgumentResolver.Factory resolverFactory) Defines the supplied method as a dynamic invocation bootstrap target for delegating advice methods.bootstrap(MethodDescription.InDefinedShape bootstrap) Defines the supplied method description as a dynamic invocation bootstrap target for delegating advice methods.bootstrap(MethodDescription.InDefinedShape bootstrap, MemberSubstitution.Substitution.Chain.Step.ForDelegation.BootstrapArgumentResolver.Factory resolverFactory) Defines the supplied method description as a dynamic invocation bootstrap target for delegating advice methods.to(Constructor<?> constructor) Returns a delegating step factory for the supplied constructor.Returns a delegating step factory for the supplied method.to(MethodDescription.InDefinedShape methodDescription) Returns a delegating step factory for the supplied method description.
-
Field Details
-
dispatcherFactory
private final MemberSubstitution.Substitution.Chain.Step.ForDelegation.Dispatcher.Factory dispatcherFactoryThe dispatcher factory to use. -
offsetMappings
private final Map<Class<? extends Annotation>,MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<?>> offsetMappingsA mapping of offset mapping factories by their respective annotation type.
-
-
Constructor Details
-
WithCustomMapping
protected WithCustomMapping(MemberSubstitution.Substitution.Chain.Step.ForDelegation.Dispatcher.Factory dispatcherFactory, Map<Class<? extends Annotation>, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<?>> offsetMappings) Creates a factory for aMemberSubstitution.Substitution.Chain.Step.ForDelegationwith a custom value.- Parameters:
dispatcherFactory- The dispatcher factory to use.offsetMappings- A mapping of offset mapping factories by their respective annotation type.
-
-
Method Details
-
bind
public <T extends Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(Class<T> type, @MaybeNull 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 valuenull.- Type Parameters:
T- The annotation type.- Parameters:
type- The type of the annotation being bound.value- The value to bind to the annotation ornullto 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(Class<T> type, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(Class<T> type, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(Class<T> type, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindSerialized(Class<T> type, 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 Annotation,S extends Serializable> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindSerialized(Class<T> type, S value, 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 ofvalueas 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindProperty(Class<T> type, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(Class<T> type, StackManipulation stackManipulation, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindLambda(Class<T> type, Constructor<?> constructor, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindLambda(Class<T> type, Constructor<?> constructor, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindLambda(Class<T> type, Method method, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindLambda(Class<T> type, Method method, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindLambda(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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindLambda(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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindDynamic(Class<T> type, Method bootstrapMethod, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindDynamic(Class<T> type, Method bootstrapMethod, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindDynamic(Class<T> type, Constructor<?> bootstrapMethod, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindDynamic(Class<T> type, Constructor<?> bootstrapMethod, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindDynamic(Class<T> type, MethodDescription.InDefinedShape bootstrapMethod, 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 Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bindDynamic(Class<T> type, MethodDescription.InDefinedShape bootstrapMethod, 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.
-
bind
public <T extends Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(Class<T> type, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping offsetMapping) 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.offsetMapping- The offset mapping being bound.- Returns:
- A new builder for a delegation that considers the supplied annotation during binding.
-
bind
public MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<?> offsetMapping) Binds an annotation to a dynamically computed value. Whenever theMemberSubstitution.Substitution.Chain.Step.ForDelegationtarget discovers the given annotation on a parameter of an advice method, the dynamic value is asked to provide a value that is then assigned to the parameter in question.- Parameters:
offsetMapping- The dynamic value that is computed for binding the parameter to a value.- Returns:
- A new builder for a delegation that considers the supplied annotation type during binding.
-
bootstrap
public MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bootstrap(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.Lookuprepresenting the source method. - A
Stringrepresenting the constructor's internal name<init>. - A
java.lang.invoke.MethodTyperepresenting the type that is requested for binding. - A
Stringrepresentation of the delegate's binary class name. - A
Classrepresenting the receiver type of the substituted element. - A
Stringrepresenting the internal name of the substituted element. - A
java.lang.invoke.MethodHandleto the substituted element. - A
Classdescribing the instrumented type. - A
Stringrepresenting 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.
- A
-
bootstrap
public MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bootstrap(Constructor<?> constructor, MemberSubstitution.Substitution.Chain.Step.ForDelegation.BootstrapArgumentResolver.Factory resolverFactory) Defines the supplied constructor as a dynamic invocation bootstrap target for delegating advice methods.- Parameters:
constructor- The bootstrap method or constructor.resolverFactory- A factory for resolving the arguments to the bootstrap method.- 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(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.Lookuprepresenting the source method. - A
Stringrepresenting the method's name. - A
java.lang.invoke.MethodTyperepresenting the type that is requested for binding. - A
Stringrepresentation of the delegate's binary class name. - A
Classrepresenting the receiver type of the substituted element. - A
Stringrepresenting the internal name of the substituted element. - A
java.lang.invoke.MethodHandleto the substituted element. - A
Classdescribing the instrumented type. - A
Stringrepresenting 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.
- A
-
bootstrap
public MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bootstrap(Method method, MemberSubstitution.Substitution.Chain.Step.ForDelegation.BootstrapArgumentResolver.Factory resolverFactory) Defines the supplied method as a dynamic invocation bootstrap target for delegating advice methods.- Parameters:
method- The bootstrap method or constructor.resolverFactory- A factory for resolving the arguments to 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.Lookuprepresenting the source method. - A
Stringrepresenting the target's internal name. - A
java.lang.invoke.MethodTyperepresenting the type that is requested for binding. - A
Stringrepresentation of the delegate's binary class name. - A
Classrepresenting the receiver type of the substituted element. - A
Stringrepresenting the internal name of the substituted element. - A
java.lang.invoke.MethodHandleto the substituted element. - A
Classdescribing the instrumented type. - A
Stringrepresenting 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.
- A
-
bootstrap
public MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bootstrap(MethodDescription.InDefinedShape bootstrap, MemberSubstitution.Substitution.Chain.Step.ForDelegation.BootstrapArgumentResolver.Factory resolverFactory) Defines the supplied method description as a dynamic invocation bootstrap target for delegating advice methods.- Parameters:
bootstrap- The bootstrap method or constructor.resolverFactory- A factory for resolving the arguments to the bootstrap method.- Returns:
- A new builder for a delegation within a member substitution that uses the supplied method or constructor for bootstrapping.
-
to
Returns a delegating step factory for the supplied method.- Parameters:
method- The method to delegate to.- Returns:
- An appropriate step factory.
-
to
Returns a delegating step factory for the supplied constructor.- Parameters:
constructor- the constructor to delegate to.- Returns:
- An appropriate step factory.
-
to
public MemberSubstitution.Substitution.Chain.Step.Factory to(MethodDescription.InDefinedShape methodDescription) Returns a delegating step factory for the supplied method description.- Parameters:
methodDescription- A description of the method or constructor to delegate to.- Returns:
- An appropriate step factory.
-