Top Description Annotations Classes
[default module]

Package net.bytebuddy.implementation.bind.annotation

Annotations
@ByDefault
Imports
net.bytebuddy.utility.nullability.NeverNull

This package contains annotations, types and classes that are responsible for binding a method to calling another method by interpreting annotations that indicate how a method should be bound to another method.

Annotation Summary

Modifier and TypeAnnotation and Description
public @interface
AllArguments

Parameters that are annotated with this annotation will be assigned an array of all arguments of the instrumented method.

public @interface
Argument

Parameters that are annotated with this annotation will be assigned the value of the parameter of the source method with the given parameter.

public @interface
BindingPriority

Defines a binding priority for a target method.

public @interface
Default

Parameters that are annotated with this annotation are assigned an instance of an auxiliary proxy type that allows calling any default method of an interface of the instrumented type where the parameter type must be an interface that is directly implemented by the instrumented type.

public @interface
DefaultCall

A parameter with this annotation is assigned a proxy for invoking a default method that fits the intercepted method.

public @interface
DefaultCallHandle

A parameter with this annotation is assigned a method handle for invoking a default method that fits the intercepted method.

public @interface
DefaultMethod

A parameter with this annotation is assigned an instance of Method which invokes a default method implementation of this method.

public @interface
DefaultMethodHandle

A parameter with this annotation is assigned an instance of java.lang.invoke.MethodHandle which invokes a default method implementation of this method.

public @interface
Empty

Binds the parameter type's default value to the annotated parameter, i.e. null or a numeric value representing zero.

public @interface
FieldGetterHandle

Assigns a java.lang.invoke.MethodHandle to the annotated parameter which represents a getter of the represented field.

public @interface
FieldProxy

Using this annotation it is possible to access fields by getter and setter types.

public @interface
FieldSetterHandle

Assigns a java.lang.invoke.MethodHandle to the annotated parameter which represents a getter of the represented field.

public @interface
FieldValue

Assigns the value of a field of the instrumented type to the annotated parameter.

public @interface
IgnoreForBinding

Indicates that a given target method should never be considered for binding to a source method.

public @interface
Morph

This annotation instructs Byte Buddy to inject a proxy class that calls a method's super method with explicit arguments.

public @interface
Origin

The origin annotation provides some meta information about the source method that is bound to this method where the binding is dependant of the parameter's type:

  1. If the annotated parameter is of type java.lang.reflect.Method, java.lang.reflect.Constructor or java.lang.reflect.Executable, the parameter is assigned a reference to the method or constructor it instruments. If the reference is not assignable to the sort of the intercepted source, the target is not considered for binding.
  2. If the annotated parameter is of type java.lang.Class, the parameter is assigned a reference of the type of the instrumented type.
  3. If the annotated parameter is of type java.lang.String, the parameter is assigned a string with the value that would be returned by the Method#toString() method.
  4. If the annotated parameter is a int type, it is assigned the intercepted method's modifiers.
  5. If the annotated type is java.lang.invoke.MethodHandle, a handle of the intercepted method is injected. A java.lang.invoke.MethodHandle is stored in a class's constant pool and does therefore not face the same runtime performance limitations as a (non-cached) java.lang.reflect.Method reference. Method handles are only supported for byte code versions starting from Java 7.
  6. If the annotated type is java.lang.invoke.MethodType, a description of the intercepted method's type is injected. Method type descriptions are only supported for byte code versions starting from Java 7.
  7. If the annotated type is java.lang.invoke.MethodHandles$Lookup, a method handle lookup of the instrumented class is returned. Method type descriptions are only supported for byte code versions starting from Java 7.
public @interface
Pipe

A target method parameter that is annotated with this annotation allows to forward an intercepted method invocation to another instance.

public @interface
RuntimeType

Parameters that are annotated with this annotation will be assigned by also considering the runtime type of the target parameter.

public @interface
StubValue

A stub value represents the (boxed) default value of the intercepted method's return type.

public @interface
Super

Parameters that are annotated with this annotation are assigned an instance of an auxiliary proxy type that allows calling any super methods of the instrumented type where the parameter type must be a super type of the instrumented type.

public @interface
SuperCall

Parameters that are annotated with this annotation will be assigned a proxy for calling the instrumented method's super implementation.

public @interface
SuperCallHandle

Parameters that are annotated with this annotation will be assigned a java.lang.invoke.MethodHandle invoking the super implementation.

public @interface
SuperMethod

A parameter with this annotation is assigned an instance of Method which invokes the super implementation of this method.

public @interface
SuperMethodHandle

A parameter with this annotation is assigned an instance of java.lang.invoke.MethodHandle which invokes the super implementation of this method.

public @interface
This

Parameters that are annotated with this annotation will be assigned a reference to the instrumented object, if the instrumented method is not static.

Class Summary

Modifier and TypeClass and Description
public class
TargetMethodAnnotationDrivenBinder

This net.bytebuddy.implementation.bind.MethodDelegationBinder binds method by analyzing annotations found on the target method that is subject to a method binding.