Class TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S extends java.lang.annotation.Annotation>
- java.lang.Object
-
- net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S>
-
- Type Parameters:
S- The bound annotation's type.
- All Implemented Interfaces:
TargetMethodAnnotationDrivenBinder.ParameterBinder<S>
- Direct Known Subclasses:
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue.OfConstant
- Enclosing interface:
- TargetMethodAnnotationDrivenBinder.ParameterBinder<T extends java.lang.annotation.Annotation>
public abstract static class TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S extends java.lang.annotation.Annotation> extends java.lang.Object implements TargetMethodAnnotationDrivenBinder.ParameterBinder<S>
Implements a parameter binder that binds a fixed value to a parameter with a given annotation.
This binder is only capable to store values that can either be expressed as Java byte code or as a constant pool value. This includes primitive types,
Stringvalues,Classvalues which can also be expressed asTypeDescriptioninstances or method handles and method types for classes of a version at least of Java 7. The latter instances can also be expressed as unloadedJavaConstantrepresentations.Important: When supplying a method handle or a method type, all types that are implied must be visible to the instrumented type or an
IllegalAccessExceptionwill be thrown at runtime.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue.OfConstant<U extends java.lang.annotation.Annotation>A parameter binder that binds a fixed value to a parameter annotation when using aMethodDelegation.-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding<S extends java.lang.annotation.Annotation>, TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S extends java.lang.annotation.Annotation>
-
-
Field Summary
-
Fields inherited from interface net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder
DEFAULTS
-
-
Constructor Summary
Constructors Constructor Description ForFixedValue()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.lang.Objectbind(AnnotationDescription.Loadable<S> annotation, MethodDescription source, ParameterDescription target)Resolves a value for the given annotation on a parameter that is processed by aMethodDelegation.MethodDelegationBinder.ParameterBinding<?>bind(AnnotationDescription.Loadable<S> annotation, MethodDescription source, ParameterDescription target, Implementation.Target implementationTarget, Assigner assigner, Assigner.Typing typing)Creates a parameter binding for the given target parameter.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder
getHandledType
-
-
-
-
Method Detail
-
bind
public MethodDelegationBinder.ParameterBinding<?> bind(AnnotationDescription.Loadable<S> annotation, MethodDescription source, ParameterDescription target, Implementation.Target implementationTarget, Assigner assigner, Assigner.Typing typing)
Creates a parameter binding for the given target parameter.- Specified by:
bindin interfaceTargetMethodAnnotationDrivenBinder.ParameterBinder<S extends java.lang.annotation.Annotation>- Parameters:
annotation- The annotation that was cause for the delegation to this argument binder.source- The intercepted source method.target- Tge target parameter that is subject to be bound to intercepting thesourcemethod.implementationTarget- The target of the current implementation that is subject to this binding.assigner- An assigner that can be used for applying the binding.typing- The typing to apply.- Returns:
- A parameter binding for the requested target method parameter.
-
bind
@MaybeNull protected abstract java.lang.Object bind(AnnotationDescription.Loadable<S> annotation, MethodDescription source, ParameterDescription target)
Resolves a value for the given annotation on a parameter that is processed by aMethodDelegation.- Parameters:
annotation- The annotation that triggered this binding.source- The method for which a delegation is currently bound.target- The parameter for which a value is bound.- Returns:
- The constant pool value that is bound to this parameter or
nullfor binding this value.
-
-