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 java.lang.ObjectA factory for aMemberSubstitution.Substitution.Chain.Step.ForDelegationwhich allows for a custom configuration.
-
-
Field Summary
Fields Modifier and Type Field Description private MemberSubstitution.Substitution.Chain.Step.ForDelegation.Dispatcher.FactorydispatcherFactoryThe dispatcher factory to use.private java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<?>>offsetMappingsA mapping of offset mapping factories by their respective annotation type.
-
Constructor Summary
Constructors Modifier Constructor Description protectedWithCustomMapping(MemberSubstitution.Substitution.Chain.Step.ForDelegation.Dispatcher.Factory dispatcherFactory, java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<?>> offsetMappings)Creates a factory for aMemberSubstitution.Substitution.Chain.Step.ForDelegationwith a custom value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbind(java.lang.Class<T> type, java.lang.Class<?> value)Binds the supplied annotation to the supplied type constant.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbind(java.lang.Class<T> type, java.lang.Enum<?> value)Binds the supplied annotation to the supplied enumeration constant.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbind(java.lang.Class<T> type, java.lang.Object value)Binds the supplied annotation to a type constant of the supplied value.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbind(java.lang.Class<T> type, java.lang.reflect.Field field)Binds the supplied annotation to the value of the supplied field.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbind(java.lang.Class<T> type, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping offsetMapping)Binds the supplied annotation to the annotation's property of the specified name.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbind(java.lang.Class<T> type, EnumerationDescription value)Binds the supplied annotation to the supplied enumeration constant.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbind(java.lang.Class<T> type, FieldDescription fieldDescription)Binds the supplied annotation to the value of the supplied field.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbind(java.lang.Class<T> type, TypeDescription value)Binds the supplied annotation to the supplied type constant.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbind(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.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbind(java.lang.Class<T> type, StackManipulation stackManipulation, TypeDescription.Generic targetType)Binds the supplied annotation to the annotation's property of the specified name.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbind(java.lang.Class<T> type, ConstantValue constant)Binds the supplied annotation to the given Java constant.MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbind(MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<?> offsetMapping)Binds an annotation to a dynamically computed value.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindDynamic(java.lang.Class<T> type, java.lang.reflect.Constructor<?> bootstrapMethod, java.lang.Object... constant)Binds the supplied annotation to a dynamically bootstrapped value.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindDynamic(java.lang.Class<T> type, java.lang.reflect.Constructor<?> bootstrapMethod, java.util.List<?> constants)Binds the supplied annotation to a dynamically bootstrapped value.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindDynamic(java.lang.Class<T> type, java.lang.reflect.Method bootstrapMethod, java.lang.Object... constant)Binds the supplied annotation to a dynamically bootstrapped value.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindDynamic(java.lang.Class<T> type, java.lang.reflect.Method bootstrapMethod, java.util.List<?> constants)Binds the supplied annotation to a dynamically bootstrapped value.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindDynamic(java.lang.Class<T> type, MethodDescription.InDefinedShape bootstrapMethod, java.lang.Object... constant)Binds the supplied annotation to a dynamically bootstrapped value.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindDynamic(java.lang.Class<T> type, MethodDescription.InDefinedShape bootstrapMethod, java.util.List<?> constants)Binds the supplied annotation to a dynamically bootstrapped value.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindLambda(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.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindLambda(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.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindLambda(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.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindLambda(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.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindLambda(java.lang.Class<T> type, MethodDescription.InDefinedShape methodDescription, TypeDescription functionalInterface)Binds the supplied annotation as a lambda expression via the JVM's lambda metafactory.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindLambda(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.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindProperty(java.lang.Class<T> type, java.lang.String property)Binds the supplied annotation to the annotation's property of the specified name.<T extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindSerialized(java.lang.Class<T> type, java.io.Serializable value)Binds the supplied annotation to the supplied fixed value.<T extends java.lang.annotation.Annotation,S extends java.io.Serializable>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbindSerialized(java.lang.Class<T> type, S value, java.lang.Class<? super S> targetType)Binds the supplied annotation to the supplied fixed value.MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbootstrap(java.lang.reflect.Constructor<?> constructor)Defines the supplied constructor as a dynamic invocation bootstrap target for delegating advice methods.MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbootstrap(java.lang.reflect.Constructor<?> constructor, MemberSubstitution.Substitution.Chain.Step.ForDelegation.BootstrapArgumentResolver.Factory resolverFactory)Defines the supplied constructor as a dynamic invocation bootstrap target for delegating advice methods.MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbootstrap(java.lang.reflect.Method method)Defines the supplied method as a dynamic invocation bootstrap target for delegating advice methods.MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbootstrap(java.lang.reflect.Method method, MemberSubstitution.Substitution.Chain.Step.ForDelegation.BootstrapArgumentResolver.Factory resolverFactory)Defines the supplied method as a dynamic invocation bootstrap target for delegating advice methods.MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbootstrap(MethodDescription.InDefinedShape bootstrap)Defines the supplied method description as a dynamic invocation bootstrap target for delegating advice methods.MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMappingbootstrap(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.MemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target>to(java.lang.reflect.Constructor<?> constructor)Returns a delegating step factory for the supplied constructor.MemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target>to(java.lang.reflect.Method method)Returns a delegating step factory for the supplied method.MemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target>to(MethodDescription.InDefinedShape methodDescription)Returns a delegating step factory for the supplied method description.
-
-
-
Field Detail
-
dispatcherFactory
private final MemberSubstitution.Substitution.Chain.Step.ForDelegation.Dispatcher.Factory dispatcherFactory
The dispatcher factory to use.
-
offsetMappings
private final java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<?>> offsetMappings
A mapping of offset mapping factories by their respective annotation type.
-
-
Constructor Detail
-
WithCustomMapping
protected WithCustomMapping(MemberSubstitution.Substitution.Chain.Step.ForDelegation.Dispatcher.Factory dispatcherFactory, java.util.Map<java.lang.Class<? extends java.lang.annotation.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 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 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 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 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 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.
-
bind
public <T extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.WithCustomMapping bind(java.lang.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(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.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(java.lang.reflect.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(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.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(java.lang.reflect.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
public MemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target> to(java.lang.reflect.Method method)
Returns a delegating step factory for the supplied method.- Parameters:
method- The method to delegate to.- Returns:
- An appropriate step factory.
-
to
public MemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target> 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.
-
to
public MemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target> 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.
-
-