Top Description Inners Methods
org.easymock.bytebuddy.implementation.bind.annotation

public @Interface FieldSetterHandle

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:PARAMETER
Imports
org.easymock.bytebuddy.description.annotation.AnnotationDescription, org.easymock.bytebuddy.description.field.FieldDescription, org.easymock.bytebuddy.description.method.MethodDescription, .MethodList, .ParameterDescription, org.easymock.bytebuddy.description.type.TypeDefinition, .TypeDescription, .TypeList, org.easymock.bytebuddy.implementation.Implementation, org.easymock.bytebuddy.implementation.bind.MethodDelegationBinder, org.easymock.bytebuddy.implementation.bytecode.StackManipulation, org.easymock.bytebuddy.implementation.bytecode.assign.Assigner, org.easymock.bytebuddy.implementation.bytecode.member.MethodInvocation, .MethodVariableAccess, org.easymock.bytebuddy.utility.JavaConstant, .JavaType, org.easymock.bytebuddy.jar.asm.Opcodes, java.lang.annotation.*

Assigns a java.lang.invoke.MethodHandle to the annotated parameter which represents a getter of the represented field. For a binding to be valid, the instrumented type must be able to access a field of the given name.

Setting FieldSetterHandle#value() is optional. If the value is not set, the field value attempts to bind a setter's or getter's field if the intercepted method is an accessor method. Otherwise, the binding renders the target method to be an illegal candidate for binding.

Important Note

Don't confuse this annotation with org.easymock.bytebuddy.asm.Advice.FieldSetterHandle or org.easymock.bytebuddy.asm.MemberSubstitution.FieldSetterHandle. This annotation should be used with org.easymock.bytebuddy.implementation.MethodDelegation only.

See Also
net.bytebuddy.implementation.MethodDelegation, TargetMethodAnnotationDrivenBinder, RuntimeType

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 that declares the accessed field.
declaringType
()

Defines the type on which the field is declared.

public String

Returns:

The name of the field.
value
()

The name of the field to be accessed.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

declaringTypeback to summary
public Class<?> declaringType()

Defines the type on which the field is declared. If this value is not set, the most specific type's field is read, if two fields with the same name exist in the same type hierarchy.

Returns:Class<?>

The type that declares the accessed field.

valueback to summary
public String value()

The name of the field to be accessed.

Returns:String

The name of the field.

org.easymock.bytebuddy.implementation.bind.annotation back to summary

public final Enum FieldSetterHandle.Binder

extends Enum<FieldSetterHandle.Binder>
implements TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldSetterHandle>
Class Inheritance
All Implemented Interfaces
org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder

Binds a FieldSetterHandle annotation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class

Field Summary

Modifier and TypeField and Description
private static final MethodDescription.InDefinedShape
DECLARING_TYPE

The annotation method that for the defining type.

private final TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldSetterHandle>
delegate

A delegate parameter binder responsible for binding the parameter.

private static final MethodDescription.InDefinedShape
FIELD_NAME

The annotation method for the field's name.

public static final FieldSetterHandle.Binder
INSTANCE

The singleton instance.

Constructor Summary

AccessConstructor and Description
private
Binder(TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldSetterHandle>
A delegate parameter binder responsible for binding the parameter.
delegate
)

Creates a new binder for a FieldSetterHandle.

Method Summary

Modifier and TypeMethod and Description
public MethodDelegationBinder.ParameterBinding<?>
bind(AnnotationDescription.Loadable<FieldSetterHandle>
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 org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.bind.

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

Field Detail

DECLARING_TYPEback to summary
private static final MethodDescription.InDefinedShape DECLARING_TYPE

The annotation method that for the defining type.

delegateback to summary
private final TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldSetterHandle> delegate

A delegate parameter binder responsible for binding the parameter.

FIELD_NAMEback to summary
private static final MethodDescription.InDefinedShape FIELD_NAME

The annotation method for the field's name.

INSTANCEback to summary
public static final FieldSetterHandle.Binder INSTANCE

The singleton instance.

Constructor Detail

Binderback to summary
private Binder(TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldSetterHandle> delegate)

Creates a new binder for a FieldSetterHandle.

Parameters
delegate:TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldSetterHandle>

A delegate parameter binder responsible for binding the parameter.

Method Detail

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

Implements org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.bind.

Doc from org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.bind.

Creates a parameter binding for the given target parameter.

Parameters
annotation:AnnotationDescription.Loadable<FieldSetterHandle>

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<FieldSetterHandle> getHandledType()

Implements org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.getHandledType.

Doc from org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.getHandledType.

The annotation type that is handled by this parameter binder.

Returns:Class<FieldSetterHandle>

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

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

protected Class FieldSetterHandle.Binder.Delegate

extends TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding<FieldSetterHandle>
Class Inheritance

A delegate implementation for the FieldSetterHandle.Binder.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected MethodDelegationBinder.ParameterBinding<?>
bind(FieldDescription
The field for which this binder binds a value.
fieldDescription
,
AnnotationDescription.Loadable<FieldSetterHandle>
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
)

Implements abstract org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding.bind.

Creates a parameter binding for the given target parameter.
protected TypeDescription
declaringType(AnnotationDescription.Loadable<FieldSetterHandle>
The annotation from which to extract the declaring type.
annotation
)

Implements abstract org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding.declaringType.

Extracts the declaring type from an annotation.
protected String
fieldName(AnnotationDescription.Loadable<FieldSetterHandle>
The annotation from which to extract the field name.
annotation
)

Implements abstract org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding.fieldName.

Extracts the field name from an annotation.
public Class<FieldSetterHandle>
Inherited from org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding:
bind

Constructor Detail

Delegateback to summary
protected Delegate()

Method Detail

bindback to summary
protected MethodDelegationBinder.ParameterBinding<?> bind(FieldDescription fieldDescription, AnnotationDescription.Loadable<FieldSetterHandle> annotation, MethodDescription source, ParameterDescription target, Implementation.Target implementationTarget, Assigner assigner)

Implements abstract org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding.bind.

Doc from org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding.bind.

Creates a parameter binding for the given target parameter.

Parameters
fieldDescription:FieldDescription

The field for which this binder binds a value.

annotation:AnnotationDescription.Loadable<FieldSetterHandle>

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.

Returns:MethodDelegationBinder.ParameterBinding<?>

A parameter binding for the requested target method parameter.

Annotations
@Override
declaringTypeback to summary
protected TypeDescription declaringType(AnnotationDescription.Loadable<FieldSetterHandle> annotation)

Implements abstract org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding.declaringType.

Doc from org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding.declaringType.

Extracts the declaring type from an annotation.

Parameters
annotation:AnnotationDescription.Loadable<FieldSetterHandle>

The annotation from which to extract the declaring type.

Returns:TypeDescription

The declaring type defined by the handled annotation.

Annotations
@Override
fieldNameback to summary
protected String fieldName(AnnotationDescription.Loadable<FieldSetterHandle> annotation)

Implements abstract org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding.fieldName.

Doc from org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding.fieldName.

Extracts the field name from an annotation.

Parameters
annotation:AnnotationDescription.Loadable<FieldSetterHandle>

The annotation from which to extract the field name.

Returns:String

The field name defined by the handled annotation.

Annotations
@Override
getHandledTypeback to summary
public Class<FieldSetterHandle> getHandledType()

Implements org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.getHandledType.

Doc from org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.getHandledType.

The annotation type that is handled by this parameter binder.

Returns:Class<FieldSetterHandle>

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