Class TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S extends 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 Annotation>
public abstract static class TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S extends Annotation>
extends 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, String
values, Class
values which can also be expressed as TypeDescription
instances or method handles and method types for classes of a version at least of Java 7. The latter instances can also be
expressed as unloaded JavaConstant
representations.
Important: When supplying a method handle or a method type, all types that are implied must be visible to the instrumented
type or an IllegalAccessException
will be thrown at runtime.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
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 Annotation>, TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S extends Annotation>
-
Field Summary
Fields inherited from interface net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder
DEFAULTS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract 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
.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
-
Constructor Details
-
ForFixedValue
public ForFixedValue()
-
-
Method Details
-
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:
bind
in interfaceTargetMethodAnnotationDrivenBinder.ParameterBinder<S extends 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 thesource
method.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 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
null
for binding this value.
-