Top Description Inners Methods
net.bytebuddy.implementation.bind.annotation

public @Interface Default

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:PARAMETER
Imports
net.bytebuddy.build.HashCodeAndEqualsPlugin, net.bytebuddy.description.annotation.AnnotationDescription, net.bytebuddy.description.method.MethodDescription, .MethodList, .ParameterDescription, net.bytebuddy.description.type.TypeDescription, net.bytebuddy.implementation.Implementation, net.bytebuddy.implementation.auxiliary.TypeProxy, net.bytebuddy.implementation.bind.MethodDelegationBinder, net.bytebuddy.implementation.bytecode.assign.Assigner, java.lang.annotation.*

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. The generated proxy will directly implement the parameter's interface. If the interface of the annotation is not implemented by the instrumented type, the method with this parameter is not considered as a binding target.
See Also
net.bytebuddy.implementation.MethodDelegation, net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Method Summary

Modifier and TypeMethod and Description
public Class<?>

Returns:

The type of the proxy or an indicator type, i.e. void.
proxyType
()

Determines the type that is implemented by the proxy.

public boolean

Returns:

true if the generated proxy should be java.io.Serializable.
serializableProxy
()

Determines if the generated proxy should be java.io.Serializable.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

proxyTypeback to summary
public Class<?> proxyType()

Determines the type that is implemented by the proxy. When this value is set to its default value void, the proxy is created as an instance of the parameter's type. It is not possible to set the value of this property to net.bytebuddy.dynamic.TargetType as a interface cannot implement itself.

Returns:Class<?>

The type of the proxy or an indicator type, i.e. void.

serializableProxyback to summary
public boolean serializableProxy()

Determines if the generated proxy should be java.io.Serializable. If the annotated type already is serializable, such an explicit specification is not required.

Returns:boolean

true if the generated proxy should be java.io.Serializable.

net.bytebuddy.implementation.bind.annotation back to summary

public final Enum Default.Binder

extends Enum<Default.Binder>
implements TargetMethodAnnotationDrivenBinder.ParameterBinder<Default>
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder

A binder for the net.bytebuddy.implementation.bind.annotation.Default annotation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static interface
Default.Binder.TypeLocator

Locates the type which should be the base type of the created proxy.

Field Summary

Modifier and TypeField and Description
public static final Default.Binder
INSTANCE

The singleton instance.

private static final MethodDescription.InDefinedShape
PROXY_TYPE

A method reference to the proxy type property.

private static final MethodDescription.InDefinedShape
SERIALIZABLE_PROXY

A method reference to the serializable proxy property.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public MethodDelegationBinder.ParameterBinding<?>
bind(AnnotationDescription.Loadable<Default>
The annotation that was cause for the delegation to this argument binder.
annotation
,
MethodDescription
The intercepted source method.
source
,
ParameterDescription
Tge target parameter that is subject to be bound to intercepting the source method.
target
,
Implementation.Target
The target of the current implementation that is subject to this binding.
implementationTarget
,
Assigner
An assigner that can be used for applying the binding.
assigner
,
Assigner.Typing
The typing to apply.
typing
)

Implements net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.bind.

Creates a parameter binding for the given target parameter.
public Class<Default>
public static Default.Binder
public static Default.Binder[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final Default.Binder INSTANCE

The singleton instance.

PROXY_TYPEback to summary
private static final MethodDescription.InDefinedShape PROXY_TYPE

A method reference to the proxy type property.

SERIALIZABLE_PROXYback to summary
private static final MethodDescription.InDefinedShape SERIALIZABLE_PROXY

A method reference to the serializable proxy property.

Constructor Detail

Binderback to summary
private Binder()

Method Detail

bindback to summary
public MethodDelegationBinder.ParameterBinding<?> bind(AnnotationDescription.Loadable<Default> annotation, MethodDescription source, ParameterDescription target, Implementation.Target implementationTarget, Assigner assigner, Assigner.Typing typing)

Implements net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.bind.

Doc from net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.bind.

Creates a parameter binding for the given target parameter.

Parameters
annotation:AnnotationDescription.Loadable<Default>

The annotation that was cause for the delegation to this argument binder.

source:MethodDescription

The intercepted source method.

target:ParameterDescription

Tge target parameter that is subject to be bound to intercepting the source method.

implementationTarget:Implementation.Target

The target of the current implementation that is subject to this binding.

assigner:Assigner

An assigner that can be used for applying the binding.

typing:Assigner.Typing

The typing to apply.

Returns:MethodDelegationBinder.ParameterBinding<?>

A parameter binding for the requested target method parameter.

getHandledTypeback to summary
public Class<Default> getHandledType()

Implements net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.getHandledType.

Doc from net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.getHandledType.

The annotation type that is handled by this parameter binder.

Returns:Class<Default>

The java.lang.annotation.Annotation#annotationType() handled by this parameter binder.

valueOfback to summary
public static Default.Binder valueOf(String name)
valuesback to summary
public static Default.Binder[] values()
net.bytebuddy.implementation.bind.annotation back to summary

protected Interface Default.Binder.TypeLocator

Known Direct Implementers
net.bytebuddy.implementation.bind.annotation.Default.Binder.TypeLocator.ForParameterType, net.bytebuddy.implementation.bind.annotation.Default.Binder.TypeLocator.ForType

Locates the type which should be the base type of the created proxy.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Default.Binder.TypeLocator.ForParameterType

A type locator that yields the target parameter's type.

public static class
Default.Binder.TypeLocator.ForType

A type locator that returns a given type.

Method Summary

Modifier and TypeMethod and Description
public TypeDescription

Returns:

The proxy type.
resolve
(TypeDescription.Generic
The type of the target parameter.
parameterType
)

Resolves the target type.

Method Detail

resolveback to summary
public TypeDescription resolve(TypeDescription.Generic parameterType)

Resolves the target type.

Parameters
parameterType:TypeDescription.Generic

The type of the target parameter.

Returns:TypeDescription

The proxy type.

net.bytebuddy.implementation.bind.annotation back to summary

public final Enum Default.Binder.TypeLocator.ForParameterType

extends Enum<Default.Binder.TypeLocator.ForParameterType>
implements TypeLocator
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.bind.annotation.Default.Binder.TypeLocator

A type locator that yields the target parameter's type.

Field Summary

Modifier and TypeField and Description
public static final Default.Binder.TypeLocator.ForParameterType
INSTANCE

The singleton instance.

Constructor Summary

AccessConstructor and Description
private

Field Detail

INSTANCEback to summary
public static final Default.Binder.TypeLocator.ForParameterType INSTANCE

The singleton instance.

Constructor Detail

ForParameterTypeback to summary
private ForParameterType()

Method Detail

resolveback to summary
public TypeDescription resolve(TypeDescription.Generic parameterType)

Implements net.bytebuddy.implementation.bind.annotation.Default.Binder.TypeLocator.resolve.

Doc from net.bytebuddy.implementation.bind.annotation.Default.Binder.TypeLocator.resolve.

Resolves the target type.

Parameters
parameterType:TypeDescription.Generic

The type of the target parameter.

Returns:TypeDescription

The proxy type.

valueOfback to summary
public static Default.Binder.TypeLocator.ForParameterType valueOf(String name)
valuesback to summary
public static Default.Binder.TypeLocator.ForParameterType[] values()
net.bytebuddy.implementation.bind.annotation back to summary

public Class Default.Binder.TypeLocator.ForType

extends Object
implements TypeLocator
Class Inheritance
  • java.lang.Object
  • net.bytebuddy.implementation.bind.annotation.Default.Binder.TypeLocator.ForType
All Implemented Interfaces
net.bytebuddy.implementation.bind.annotation.Default.Binder.TypeLocator
Annotations
@Enhance

A type locator that returns a given type.

Field Summary

Modifier and TypeField and Description
private final TypeDescription
typeDescription

The type to be returned upon resolution.

Constructor Summary

AccessConstructor and Description
protected
ForType(TypeDescription
The type to be returned upon resolution.
typeDescription
)

Creates a new type locator for a given type.

Method Summary

Modifier and TypeMethod and Description
protected static Default.Binder.TypeLocator

Returns:

The appropriate type locator.
of
(TypeDescription
The annotation's value.
typeDescription
)

Resolves a type locator based upon an annotation value.

public TypeDescription
resolve(TypeDescription.Generic
The type of the target parameter.
parameterType
)

Implements net.bytebuddy.implementation.bind.annotation.Default.Binder.TypeLocator.resolve.

Resolves the target type.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

typeDescriptionback to summary
private final TypeDescription typeDescription

The type to be returned upon resolution.

Constructor Detail

ForTypeback to summary
protected ForType(TypeDescription typeDescription)

Creates a new type locator for a given type.

Parameters
typeDescription:TypeDescription

The type to be returned upon resolution.

Method Detail

ofback to summary
protected static Default.Binder.TypeLocator of(TypeDescription typeDescription)

Resolves a type locator based upon an annotation value.

Parameters
typeDescription:TypeDescription

The annotation's value.

Returns:Default.Binder.TypeLocator

The appropriate type locator.

resolveback to summary
public TypeDescription resolve(TypeDescription.Generic parameterType)

Implements net.bytebuddy.implementation.bind.annotation.Default.Binder.TypeLocator.resolve.

Doc from net.bytebuddy.implementation.bind.annotation.Default.Binder.TypeLocator.resolve.

Resolves the target type.

Parameters
parameterType:TypeDescription.Generic

The type of the target parameter.

Returns:TypeDescription

The proxy type.