Top Description Inners Fields Constructors Methods
org.easymock.bytebuddy.implementation

public abstract Class FieldAccessor

extends Object
implements Implementation
Class Inheritance
All Implemented Interfaces
org.easymock.bytebuddy.implementation.Implementation, org.easymock.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
Known Direct Subclasses
org.easymock.bytebuddy.implementation.FieldAccessor.ForImplicitProperty, org.easymock.bytebuddy.implementation.FieldAccessor.ForSetter
Annotations
@Enhance
Imports
edu.umd.cs.findbugs.annotations.SuppressFBWarnings, org.easymock.bytebuddy.build.HashCodeAndEqualsPlugin, org.easymock.bytebuddy.description.field.FieldDescription, org.easymock.bytebuddy.description.method.MethodDescription, org.easymock.bytebuddy.description.type.TypeDescription, org.easymock.bytebuddy.dynamic.scaffold.FieldLocator, .InstrumentedType, org.easymock.bytebuddy.implementation.bytecode.ByteCodeAppender, .StackManipulation, org.easymock.bytebuddy.implementation.bytecode.assign.Assigner, org.easymock.bytebuddy.implementation.bytecode.constant.ClassConstant, .DefaultValue, org.easymock.bytebuddy.implementation.bytecode.member.FieldAccess, .MethodReturn, .MethodVariableAccess, org.easymock.bytebuddy.utility.ConstantValue, .JavaConstant, .RandomString, org.easymock.bytebuddy.utility.nullability.AlwaysNull, .MaybeNull, org.easymock.bytebuddy.jar.asm.MethodVisitor, .Opcodes, java.lang.reflect.Field, .Type, java.util.Arrays, .Collections, .Iterator, .List

Defines a method to access a given field by following the Java bean conventions for getters and setters:

Field accessors always implement a getter if a non-void value is returned from a method and attempt to define a setter otherwise. If a field accessor is not explicitly defined as a setter via PropertyConfigurable, an instrumented method must define exactly one parameter. Using the latter API, an explicit parameter index can be defined and a return value can be specified explicitly when void is not returned.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
FieldAccessor.AssignerConfigurable

A field accessor that can be configured to use a given assigner and runtime type use configuration.

protected static interface
FieldAccessor.FieldLocation

A field location represents an identified field description which depends on the instrumented type and method.

public static interface
FieldAccessor.FieldNameExtractor

A field name extractor is responsible for determining a field name to a method that is implemented to access this method.

protected static class
FieldAccessor.ForImplicitProperty

A field accessor for an implicit property where a getter or setter property is inferred from the signature.

protected abstract static class
FieldAccessor.ForSetter<
The type of the value that is initialized per instrumented type.
T
>

A field accessor for a field setter.

public static interface
FieldAccessor.OwnerTypeLocatable

A field accessor that can be configured to locate a field in a specific manner.

public static interface
FieldAccessor.PropertyConfigurable

A field accessor that allows to define the access to be a field write of a given argument.

Field Summary

Modifier and TypeField and Description
protected final Assigner
assigner

The assigner to use.

protected final FieldAccessor.FieldLocation
fieldLocation

The field's location.

protected final Assigner.Typing
typing

Indicates if dynamic type castings should be attempted for incompatible assignments.

Constructor Summary

AccessConstructor and Description
protected
FieldAccessor(FieldAccessor.FieldLocation
The field's location.
fieldLocation
,
Assigner
The assigner to use.
assigner
,
Assigner.Typing
Indicates if dynamic type castings should be attempted for incompatible assignments.
typing
)

Creates a new field accessor.

Method Summary

Modifier and TypeMethod and Description
public static FieldAccessor.OwnerTypeLocatable

Returns:

A field accessor using the given field name extractor.
of
(FieldAccessor.FieldNameExtractor
The field name extractor to use.
fieldNameExtractor
)

Defines a custom strategy for determining the field that is accessed by this field accessor.

public static FieldAccessor.OwnerTypeLocatable

Returns:

A field accessor using the given field name extractor.
of
(FieldAccessor.FieldNameExtractor...
The field name extractors to use in their application order.
fieldNameExtractor
)

Defines a custom strategy for determining the field that is accessed by this field accessor.

public static FieldAccessor.OwnerTypeLocatable

Returns:

A field accessor using the given field name extractor.
of
(List<? extends FieldAccessor.FieldNameExtractor>
The field name extractors to use in their application order.
fieldNameExtractors
)

Defines a custom strategy for determining the field that is accessed by this field accessor.

public static FieldAccessor.AssignerConfigurable

Returns:

A field accessor for the given field.
of
(Field
The field being accessed.
field
)

Defines a field accessor where the specified field is accessed.

public static FieldAccessor.AssignerConfigurable

Returns:

A field accessor for the given field.
of
(FieldDescription
The field being accessed.
fieldDescription
)

Defines a field accessor where the specified field is accessed.

public static FieldAccessor.OwnerTypeLocatable

Returns:

A field accessor that follows the Java naming conventions for bean properties.
ofBeanProperty
()

Defines a field accessor where any access is targeted to a field that matches the methods name with the Java specification for bean properties, i.e. a method getFoo or setFoo(value) will either read or write a field named foo.

public static FieldAccessor.OwnerTypeLocatable

Returns:

A field accessor for a field of a given name.
ofField
(String
The name of the field to be accessed.
name
)

Defines a field accessor where any access is targeted to a field named name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait