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

public @Interface DefaultCallHandle

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.TypeDefinition, .TypeDescription, .TypeList, net.bytebuddy.implementation.Implementation, net.bytebuddy.implementation.bind.MethodDelegationBinder, net.bytebuddy.implementation.bytecode.StackManipulation, net.bytebuddy.implementation.bytecode.assign.Assigner, net.bytebuddy.implementation.bytecode.collection.ArrayFactory, net.bytebuddy.implementation.bytecode.constant.IntegerConstant, .NullConstant, net.bytebuddy.implementation.bytecode.member.MethodInvocation, .MethodVariableAccess, net.bytebuddy.utility.JavaType, net.bytebuddy.jar.asm.Opcodes, java.lang.annotation.*, java.util.ArrayList, .List

A parameter with this annotation is assigned a method handle for invoking a default method that fits the intercepted method. If no suitable default method for the intercepted method can be identified, the target method with the annotated parameter is considered to be unbindable, unless a null value is requested by setting a property.
See Also
net.bytebuddy.implementation.MethodDelegation, TargetMethodAnnotationDrivenBinder

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
DefaultCallHandle.Binder

A binder for handling the DefaultCallHandle annotation.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if a null constant should be assigned to this parameter in case that a legal binding is impossible.
nullIfImpossible
()

Assigns null to the parameter if it is impossible to invoke the super method or a possible dominant default method, if permitted.

public Class<?>

Returns:

The target interface that a default method invocation is to be defined upon. If no such explicit target is set, this parameter should not be defined as the predefined void type encodes an implicit resolution.
targetType
()

If this parameter is not explicitly set, a parameter with the DefaultCallHandle is only bound to a source method if this source method directly represents an unambiguous, invokable default method.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

nullIfImpossibleback to summary
public boolean nullIfImpossible()

Assigns null to the parameter if it is impossible to invoke the super method or a possible dominant default method, if permitted.

Returns:boolean

true if a null constant should be assigned to this parameter in case that a legal binding is impossible.

targetTypeback to summary
public Class<?> targetType()

If this parameter is not explicitly set, a parameter with the DefaultCallHandle is only bound to a source method if this source method directly represents an unambiguous, invokable default method. On the other hand, if a method is not defined unambiguously by an interface, not setting this parameter will exclude the target method with the annotated parameter from a binding to the source method.

 

If this parameter is however set to an explicit interface type, a default method is always invoked on this given type as long as this type defines a method with a compatible signature. If this is not the case, the target method with the annotated parameter is no longer considered as a possible binding candidate of a source method.
Returns:Class<?>

The target interface that a default method invocation is to be defined upon. If no such explicit target is set, this parameter should not be defined as the predefined void type encodes an implicit resolution.

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

public final Enum DefaultCallHandle.Binder

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

A binder for handling the DefaultCallHandle annotation.
See Also
TargetMethodAnnotationDrivenBinder

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static interface
DefaultCallHandle.Binder.DefaultMethodLocator

A default method locator is responsible for looking up a default method to a given source method.

Field Summary

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

The singleton instance.

private static final MethodDescription.InDefinedShape
NULL_IF_IMPOSSIBLE

A reference to the null if possible method of the default call annotation.

private static final MethodDescription.InDefinedShape
TARGET_TYPE

A reference to the target type method of the default call annotation.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public MethodDelegationBinder.ParameterBinding<?>
bind(AnnotationDescription.Loadable<DefaultCallHandle>
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<DefaultCallHandle>
public static DefaultCallHandle.Binder
public static DefaultCallHandle.Binder[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final DefaultCallHandle.Binder INSTANCE

The singleton instance.

NULL_IF_IMPOSSIBLEback to summary
private static final MethodDescription.InDefinedShape NULL_IF_IMPOSSIBLE

A reference to the null if possible method of the default call annotation.

TARGET_TYPEback to summary
private static final MethodDescription.InDefinedShape TARGET_TYPE

A reference to the target type method of the default call annotation.

Constructor Detail

Binderback to summary
private Binder()

Method Detail

bindback to summary
public MethodDelegationBinder.ParameterBinding<?> bind(AnnotationDescription.Loadable<DefaultCallHandle> 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<DefaultCallHandle>

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<DefaultCallHandle> 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<DefaultCallHandle>

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

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

protected Interface DefaultCallHandle.Binder.DefaultMethodLocator

Known Direct Implementers
net.bytebuddy.implementation.bind.annotation.DefaultCallHandle.Binder.DefaultMethodLocator.Implicit, net.bytebuddy.implementation.bind.annotation.DefaultCallHandle.Binder.DefaultMethodLocator.Explicit

A default method locator is responsible for looking up a default method to a given source method.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
DefaultCallHandle.Binder.DefaultMethodLocator.Explicit

An explicit default method locator attempts to look up a default method in the specified interface type.

public static enum
DefaultCallHandle.Binder.DefaultMethodLocator.Implicit

An implicit default method locator that only permits the invocation of a default method if the source method itself represents a method that was defined on a default method interface.

Method Summary

Modifier and TypeMethod and Description
public Implementation.SpecialMethodInvocation

Returns:

A special method invocation of the default method or an illegal special method invocation, if no suitable invocation could be located.
resolve
(Implementation.Target
The current implementation target.
implementationTarget
,
MethodDescription
The source method for which a default method should be looked up.
source
)

Locates the correct default method to a given source method.

Method Detail

resolveback to summary
public Implementation.SpecialMethodInvocation resolve(Implementation.Target implementationTarget, MethodDescription source)

Locates the correct default method to a given source method.

Parameters
implementationTarget:Implementation.Target

The current implementation target.

source:MethodDescription

The source method for which a default method should be looked up.

Returns:Implementation.SpecialMethodInvocation

A special method invocation of the default method or an illegal special method invocation, if no suitable invocation could be located.

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

public Class DefaultCallHandle.Binder.DefaultMethodLocator.Explicit

extends Object
implements DefaultMethodLocator
Class Inheritance
  • java.lang.Object
  • net.bytebuddy.implementation.bind.annotation.DefaultCallHandle.Binder.DefaultMethodLocator.Explicit
All Implemented Interfaces
net.bytebuddy.implementation.bind.annotation.DefaultCallHandle.Binder.DefaultMethodLocator
Annotations
@Enhance

An explicit default method locator attempts to look up a default method in the specified interface type.

Field Summary

Modifier and TypeField and Description
private final TypeDescription
typeDescription

A description of the type on which the default method should be invoked.

Constructor Summary

AccessConstructor and Description
public
Explicit(TypeDescription
The actual target interface as explicitly defined by DefaultCallHandle#targetType().
typeDescription
)

Creates a new explicit default method locator.

Method Summary

Modifier and TypeMethod and Description
public Implementation.SpecialMethodInvocation
resolve(Implementation.Target
The current implementation target.
implementationTarget
,
MethodDescription
The source method for which a default method should be looked up.
source
)

Implements net.bytebuddy.implementation.bind.annotation.DefaultCallHandle.Binder.DefaultMethodLocator.resolve.

Locates the correct default method to a given source method.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

typeDescriptionback to summary
private final TypeDescription typeDescription

A description of the type on which the default method should be invoked.

Constructor Detail

Explicitback to summary
public Explicit(TypeDescription typeDescription)

Creates a new explicit default method locator.

Parameters
typeDescription:TypeDescription

The actual target interface as explicitly defined by DefaultCallHandle#targetType().

Method Detail

resolveback to summary
public Implementation.SpecialMethodInvocation resolve(Implementation.Target implementationTarget, MethodDescription source)

Implements net.bytebuddy.implementation.bind.annotation.DefaultCallHandle.Binder.DefaultMethodLocator.resolve.

Doc from net.bytebuddy.implementation.bind.annotation.DefaultCallHandle.Binder.DefaultMethodLocator.resolve.

Locates the correct default method to a given source method.

Parameters
implementationTarget:Implementation.Target

The current implementation target.

source:MethodDescription

The source method for which a default method should be looked up.

Returns:Implementation.SpecialMethodInvocation

A special method invocation of the default method or an illegal special method invocation, if no suitable invocation could be located.

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

public final Enum DefaultCallHandle.Binder.DefaultMethodLocator.Implicit

extends Enum<DefaultCallHandle.Binder.DefaultMethodLocator.Implicit>
implements DefaultMethodLocator
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.bind.annotation.DefaultCallHandle.Binder.DefaultMethodLocator

An implicit default method locator that only permits the invocation of a default method if the source method itself represents a method that was defined on a default method interface.

Field Summary

Modifier and TypeField and Description
public static final DefaultCallHandle.Binder.DefaultMethodLocator.Implicit
INSTANCE

The singleton instance.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Implementation.SpecialMethodInvocation
resolve(Implementation.Target
The current implementation target.
implementationTarget
,
MethodDescription
The source method for which a default method should be looked up.
source
)

Implements net.bytebuddy.implementation.bind.annotation.DefaultCallHandle.Binder.DefaultMethodLocator.resolve.

Locates the correct default method to a given source method.
public static DefaultCallHandle.Binder.DefaultMethodLocator.Implicit
public static DefaultCallHandle.Binder.DefaultMethodLocator.Implicit[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final DefaultCallHandle.Binder.DefaultMethodLocator.Implicit INSTANCE

The singleton instance.

Constructor Detail

Implicitback to summary
private Implicit()

Method Detail

resolveback to summary
public Implementation.SpecialMethodInvocation resolve(Implementation.Target implementationTarget, MethodDescription source)

Implements net.bytebuddy.implementation.bind.annotation.DefaultCallHandle.Binder.DefaultMethodLocator.resolve.

Doc from net.bytebuddy.implementation.bind.annotation.DefaultCallHandle.Binder.DefaultMethodLocator.resolve.

Locates the correct default method to a given source method.

Parameters
implementationTarget:Implementation.Target

The current implementation target.

source:MethodDescription

The source method for which a default method should be looked up.

Returns:Implementation.SpecialMethodInvocation

A special method invocation of the default method or an illegal special method invocation, if no suitable invocation could be located.

valueOfback to summary
public static DefaultCallHandle.Binder.DefaultMethodLocator.Implicit valueOf(String name)
valuesback to summary
public static DefaultCallHandle.Binder.DefaultMethodLocator.Implicit[] values()