protected static class FieldAccessor.ForNamedField extends FieldAccessor implements FieldAccessor.FieldDefinable
ofBeanProperty
Modifier and Type | Class and Description |
---|---|
protected static interface |
FieldAccessor.ForNamedField.PreparationHandler
A preparation handler is responsible for defining a field value on an implementation, if necessary.
|
FieldAccessor.Appender, FieldAccessor.AssignerConfigurable, FieldAccessor.FieldDefinable, FieldAccessor.FieldLocator, FieldAccessor.FieldNameExtractor, FieldAccessor.ForNamedField, FieldAccessor.ForUnnamedField, FieldAccessor.OwnerTypeLocatable
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target
assigner, typing
Modifier | Constructor and Description |
---|---|
protected |
ForNamedField(Assigner assigner,
Assigner.Typing typing,
String fieldName)
Creates a field accessor implementation for a field of a given name.
|
Modifier and Type | Method and Description |
---|---|
ByteCodeAppender |
appender(Implementation.Target implementationTarget)
Creates a byte code appender that determines the implementation of the instrumented type's methods.
|
FieldAccessor.AssignerConfigurable |
defineAs(TypeDefinition typeDefinition,
ModifierContributor.ForField... modifier)
Defines a field with the given name in the instrumented type.
|
FieldAccessor.AssignerConfigurable |
defineAs(Type type,
ModifierContributor.ForField... modifier)
Defines a field with the given name in the instrumented type.
|
boolean |
equals(Object other) |
protected String |
getFieldName(MethodDescription targetMethod)
Locates a field's name.
|
int |
hashCode() |
FieldAccessor.AssignerConfigurable |
in(Class<?> type)
Determines that a field should only be considered when it was defined in a given type.
|
FieldAccessor.AssignerConfigurable |
in(FieldAccessor.FieldLocator.Factory fieldLocatorFactory)
Determines that a field should only be considered when it was identified by a field locator that is
produced by the given factory.
|
FieldAccessor.AssignerConfigurable |
in(TypeDescription typeDescription)
Determines that a field should only be considered when it was defined in a given type.
|
InstrumentedType |
prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.
|
String |
toString() |
Implementation |
withAssigner(Assigner assigner,
Assigner.Typing typing)
Returns a field accessor that is identical to this field accessor but uses the given assigner
and runtime type use configuration.
|
applyGetter, applySetter, of, ofBeanProperty, ofField
protected ForNamedField(Assigner assigner, Assigner.Typing typing, String fieldName)
assigner
- The assigner to use.typing
- Indicates if dynamic type castings should be attempted for incompatible assignments.fieldName
- The name of the field.public FieldAccessor.AssignerConfigurable defineAs(Type type, ModifierContributor.ForField... modifier)
FieldAccessor.FieldDefinable
defineAs
in interface FieldAccessor.FieldDefinable
type
- The type of the field.modifier
- The modifiers for the field.public FieldAccessor.AssignerConfigurable defineAs(TypeDefinition typeDefinition, ModifierContributor.ForField... modifier)
FieldAccessor.FieldDefinable
defineAs
in interface FieldAccessor.FieldDefinable
typeDefinition
- The type of the field.modifier
- The modifiers for the field.public FieldAccessor.AssignerConfigurable in(FieldAccessor.FieldLocator.Factory fieldLocatorFactory)
FieldAccessor.OwnerTypeLocatable
in
in interface FieldAccessor.OwnerTypeLocatable
fieldLocatorFactory
- A factory that will produce a field locator that will be used to find locate
a field to be accessed.public FieldAccessor.AssignerConfigurable in(Class<?> type)
FieldAccessor.OwnerTypeLocatable
in
in interface FieldAccessor.OwnerTypeLocatable
type
- The type to be considered.public FieldAccessor.AssignerConfigurable in(TypeDescription typeDescription)
FieldAccessor.OwnerTypeLocatable
in
in interface FieldAccessor.OwnerTypeLocatable
typeDescription
- A description of the type to be considered.public Implementation withAssigner(Assigner assigner, Assigner.Typing typing)
FieldAccessor.AssignerConfigurable
withAssigner
in interface FieldAccessor.AssignerConfigurable
assigner
- The assigner to use.typing
- Indicates if dynamic type castings should be attempted for incompatible assignments.public InstrumentedType prepare(InstrumentedType instrumentedType)
InstrumentedType.Prepareable
prepare
in interface InstrumentedType.Prepareable
instrumentedType
- The instrumented type in its current form.public ByteCodeAppender appender(Implementation.Target implementationTarget)
Implementation
appender
in interface Implementation
implementationTarget
- The target of the current implementation.InstrumentedType.Prepareable.prepare(InstrumentedType)
.protected String getFieldName(MethodDescription targetMethod)
FieldAccessor
getFieldName
in class FieldAccessor
targetMethod
- The method that is target of the implementation.public boolean equals(Object other)
equals
in class FieldAccessor
public int hashCode()
hashCode
in class FieldAccessor
Copyright © 2014–2016. All rights reserved.