Class FieldAccessor.ForSetter.OfFieldValue
java.lang.Object
net.bytebuddy.implementation.FieldAccessor
net.bytebuddy.implementation.FieldAccessor.ForSetter<FieldAccessor.FieldLocation.Prepared>
net.bytebuddy.implementation.FieldAccessor.ForSetter.OfFieldValue
- All Implemented Interfaces:
InstrumentedType.Prepareable, Implementation, Implementation.Composable
- Enclosing class:
FieldAccessor.ForSetter<T>
@Enhance
protected static class FieldAccessor.ForSetter.OfFieldValue
extends FieldAccessor.ForSetter<FieldAccessor.FieldLocation.Prepared>
A setter that reads a value of another field and sets this value.
-
Nested Class Summary
Nested classes/interfaces inherited from class FieldAccessor.ForSetter
FieldAccessor.ForSetter.Appender, FieldAccessor.ForSetter.OfConstantValue, FieldAccessor.ForSetter.OfDefaultValue, FieldAccessor.ForSetter.OfFieldValue, FieldAccessor.ForSetter.OfParameterValue, FieldAccessor.ForSetter.OfReferenceValue, FieldAccessor.ForSetter.TerminationHandlerNested classes/interfaces inherited from class FieldAccessor
FieldAccessor.AssignerConfigurable, FieldAccessor.FieldLocation, FieldAccessor.FieldNameExtractor, FieldAccessor.ForImplicitProperty, FieldAccessor.ForSetter<T>, FieldAccessor.OwnerTypeLocatable, FieldAccessor.PropertyConfigurableNested classes/interfaces inherited from interface Implementation
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.TargetNested classes/interfaces inherited from interface InstrumentedType.Prepareable
InstrumentedType.Prepareable.NoOp -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FieldAccessor.FieldLocationThe target field locator.Fields inherited from class FieldAccessor
assigner, fieldLocation, typing -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOfFieldValue(FieldAccessor.FieldLocation fieldLocation, Assigner assigner, Assigner.Typing typing, FieldAccessor.ForSetter.TerminationHandler terminationHandler, FieldAccessor.FieldLocation target) Creates a setter that sets another field value. -
Method Summary
Modifier and TypeMethodDescriptionandThen(Implementation implementation) Appends the supplied implementation to this implementation.andThen(Implementation.Composable implementation) Appends the supplied composable implementation to this implementation.protected FieldAccessor.FieldLocation.Preparedinitialize(TypeDescription instrumentedType) Initializes a value to be used during method instrumentation.prepare(InstrumentedType instrumentedType) Prepares a given instrumented type.protected StackManipulationresolve(FieldAccessor.FieldLocation.Prepared target, FieldDescription fieldDescription, TypeDescription instrumentedType, MethodDescription instrumentedMethod) Resolves the stack manipulation to load the value being set.Methods inherited from class FieldAccessor.ForSetter
appenderMethods inherited from class FieldAccessor
of, of, of, of, of, ofBeanProperty, ofField
-
Field Details
-
target
The target field locator.
-
-
Constructor Details
-
OfFieldValue
protected OfFieldValue(FieldAccessor.FieldLocation fieldLocation, Assigner assigner, Assigner.Typing typing, FieldAccessor.ForSetter.TerminationHandler terminationHandler, FieldAccessor.FieldLocation target) Creates a setter that sets another field value.- Parameters:
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.target- The target field locator.
-
-
Method Details
-
prepare
Prepares a given instrumented type.- Parameters:
instrumentedType- The instrumented type in its current form.- Returns:
- The prepared instrumented type.
-
initialize
Initializes a value to be used during method instrumentation.- Specified by:
initializein classFieldAccessor.ForSetter<FieldAccessor.FieldLocation.Prepared>- Parameters:
instrumentedType- The instrumented type.- Returns:
- The initialized value.
-
resolve
protected StackManipulation resolve(@MaybeNull FieldAccessor.FieldLocation.Prepared target, FieldDescription fieldDescription, TypeDescription instrumentedType, MethodDescription instrumentedMethod) Resolves the stack manipulation to load the value being set.- Specified by:
resolvein classFieldAccessor.ForSetter<FieldAccessor.FieldLocation.Prepared>- Parameters:
target- 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.- Returns:
- The stack manipulation to apply.
-
andThen
Appends the supplied implementation to this implementation.- Parameters:
implementation- The subsequent implementation.- Returns:
- An implementation that combines this implementation with the provided one.
-
andThen
Appends the supplied composable implementation to this implementation.- Parameters:
implementation- The subsequent composable implementation.- Returns:
- A composable implementation that combines this implementation with the provided one.
-