Parameters that are annotated with this annotation will be assigned the value of the parameter of the source method
with the given parameter. For example, if source method foo(String, Integer) is bound to target method
bar(@Argument(1) Integer), the second parameter of foo will be bound to the first argument of
bar.
If a source method has less parameters than specified by Argument#value(), the method carrying this parameter
annotation is excluded from the list of possible binding candidates to this particular source method. The same happens,
if the source method parameter at the specified index is not assignable to the annotated parameter.
Important Note
Don't confuse this annotation with net. or
net.. This annotation should be used with
net. only.
net.bytebuddy.implementation.MethodDelegation , net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder , net.bytebuddy.implementation.bind.annotation.RuntimeType
| Modifier and Type | Class and Description |
|---|---|
| public static enum | Argument.Binder
A binder for handling the
|
| public static enum | Argument.BindingMechanic
Determines if a parameter binding should be considered for resolving ambiguous method bindings. |
| Modifier and Type | Method and Description |
|---|---|
| public Argument. | Returns: The binding type that should be applied to this parameter binding.Determines if the argument binding is to be considered by a
|
| public int | Returns: The required parameter index.The index of the parameter of the source method that should be bound to this parameter. |
| bindingMechanic | back to summary |
|---|---|
| public Argument. Determines if the argument binding is to be considered by a
| |
| value | back to summary |
|---|---|
| public int value() The index of the parameter of the source method that should be bound to this parameter.
| |
net.bytebuddy.implementation.bind.annotation.Argument
annotation.
TargetMethodAnnotationDrivenBinder
| Modifier and Type | Field and Description |
|---|---|
| private static final MethodDescription. | BINDING_MECHANIC
A description of the |
| public static final Argument. | INSTANCE
The singleton instance. |
| private static final MethodDescription. | VALUE
A description of the |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public MethodDelegationBinder. | bind(AnnotationDescription.
The annotation that was cause for the delegation to this argument binder. annotation,The intercepted source method. source, ParameterDescription Tge target parameter that is subject to be bound to
intercepting the target, Implementation.source method.The target of the current implementation that is subject to this binding. implementationTarget,An assigner that can be used for applying the binding. assigner, Assigner.The typing to apply. typingImplements net. |
| public Class | getHandledType()
The annotation type that is handled by this parameter binder.
|
| public static Argument. | |
| public static Argument. |
| BINDING_MECHANIC | back to summary |
|---|---|
| private static final MethodDescription. A description of the | |
| INSTANCE | back to summary |
|---|---|
| public static final Argument. The singleton instance. | |
| VALUE | back to summary |
|---|---|
| private static final MethodDescription. A description of the | |
| Binder | back to summary |
|---|---|
| private Binder() | |
| bind | back to summary |
|---|---|
| public MethodDelegationBinder. Implements net. Doc from net. Creates a parameter binding for the given target parameter.
| |
| getHandledType | back to summary |
|---|---|
| public Class The annotation type that is handled by this parameter binder.
| |
| valueOf | back to summary |
|---|---|
| public static Argument. | |
| values | back to summary |
|---|---|
| public static Argument. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Argument. | ANONYMOUS
The binding is anonymous, i.e. it can be present on several parameters of the same method. |
| public static final Argument. | UNIQUE
The binding is unique, i.e. only one such binding must be present among all parameters of a method. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract MethodDelegationBinder. | Returns: A binding considering the chosen binding mechanic.The source type to be bound. source,The target type the target,sourceType is to be bound to.The index of the source parameter. sourceParameterIndex, Assigner The assigner that is used to perform the assignment. assigner, Assigner.Indicates if dynamic type castings should be attempted for incompatible assignments. typing,The offset of the source method's parameter. parameterOffset)Creates a binding that corresponds to this binding mechanic. |
| public static Argument. | |
| public static Argument. |
| ANONYMOUS | back to summary |
|---|---|
| public static final Argument. The binding is anonymous, i.e. it can be present on several parameters of the same method. | |
| UNIQUE | back to summary |
|---|---|
| public static final Argument. The binding is unique, i.e. only one such binding must be present among all parameters of a method. As a
consequence, the binding can be latter identified by an
| |
| BindingMechanic | back to summary |
|---|---|
| private BindingMechanic() | |
| makeBinding | back to summary |
|---|---|
| protected abstract MethodDelegationBinder. Creates a binding that corresponds to this binding mechanic.
| |
| valueOf | back to summary |
|---|---|
| public static Argument. | |
| values | back to summary |
|---|---|
| public static Argument. | |