T
- The type of the value that is initialized per instrumented type.@HashCodeAndEqualsPlugin.Enhance protected abstract static class FieldAccessor.ForSetter<T> extends FieldAccessor implements Implementation.Composable
Modifier and Type | Class and Description |
---|---|
protected class |
FieldAccessor.ForSetter.Appender
An appender to implement a field setter.
|
protected static class |
FieldAccessor.ForSetter.OfConstantValue
An instrumentation that sets a constant value to a field.
|
protected static class |
FieldAccessor.ForSetter.OfDefaultValue
A setter instrumentation that sets a
null or a primitive type's default value. |
protected static class |
FieldAccessor.ForSetter.OfFieldValue
A setter that reads a value of another field and sets this value.
|
protected static class |
FieldAccessor.ForSetter.OfParameterValue
A setter instrumentation for a parameter value.
|
protected static class |
FieldAccessor.ForSetter.OfReferenceValue
An instrumentation that sets a field to a reference value that is stored in a static field of the instrumented type.
|
protected static class |
FieldAccessor.ForSetter.TerminationHandler
A termination handler is responsible for handling a field accessor's return.
|
FieldAccessor.AssignerConfigurable, FieldAccessor.FieldLocation, FieldAccessor.FieldNameExtractor, FieldAccessor.ForImplicitProperty, FieldAccessor.ForSetter<T>, FieldAccessor.OwnerTypeLocatable, FieldAccessor.PropertyConfigurable
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target
InstrumentedType.Prepareable.NoOp
assigner, fieldLocation, typing
Modifier | Constructor and Description |
---|---|
protected |
ForSetter(FieldAccessor.FieldLocation fieldLocation,
Assigner assigner,
Assigner.Typing typing,
FieldAccessor.ForSetter.TerminationHandler terminationHandler)
Creates a new field accessor for a setter instrumentation.
|
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.
|
protected abstract T |
initialize(TypeDescription instrumentedType)
Initializes a value to be used during method instrumentation.
|
protected abstract StackManipulation |
resolve(T initialized,
FieldDescription fieldDescription,
TypeDescription instrumentedType,
MethodDescription instrumentedMethod)
Resolves the stack manipulation to load the value being set.
|
of, of, of, ofBeanProperty, ofField
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
andThen, andThen
prepare
protected ForSetter(FieldAccessor.FieldLocation fieldLocation, Assigner assigner, Assigner.Typing typing, FieldAccessor.ForSetter.TerminationHandler terminationHandler)
fieldLocation
- The field's location.assigner
- The assigner to use.typing
- Indicates if dynamic type castings should be attempted for incompatible assignments.terminationHandler
- The termination handler to apply.public ByteCodeAppender appender(Implementation.Target implementationTarget)
appender
in interface Implementation
implementationTarget
- The target of the current implementation.InstrumentedType.Prepareable.prepare(InstrumentedType)
.@MaybeNull protected abstract T initialize(TypeDescription instrumentedType)
instrumentedType
- The instrumented type.protected abstract StackManipulation resolve(@MaybeNull T initialized, FieldDescription fieldDescription, TypeDescription instrumentedType, MethodDescription instrumentedMethod)
initialized
- The method that was initialized for the instrumented type.fieldDescription
- The field to set the value for.instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.Copyright © 2014–2022. All rights reserved.