Class FieldAccessor.ForSetter<T>

    • Constructor Detail

      • ForSetter

        protected ForSetter​(FieldAccessor.FieldLocation fieldLocation,
                            Assigner assigner,
                            Assigner.Typing typing,
                            FieldAccessor.ForSetter.TerminationHandler terminationHandler)
        Creates a new field accessor for a setter instrumentation.
        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.
    • Method Detail

      • appender

        public ByteCodeAppender appender​(Implementation.Target implementationTarget)
        Creates a byte code appender that determines the implementation of the instrumented type's methods.
        Specified by:
        appender in interface Implementation
        Parameters:
        implementationTarget - The target of the current implementation.
        Returns:
        A byte code appender for implementing methods delegated to this implementation. This byte code appender is also responsible for handling methods that were added by this implementation on the call to InstrumentedType.Prepareable.prepare(InstrumentedType).
      • initialize

        protected abstract T initialize​(TypeDescription instrumentedType)
        Initializes a value to be used during method instrumentation.
        Parameters:
        instrumentedType - The instrumented type.
        Returns:
        The initialized value.
      • resolve

        protected abstract StackManipulation resolve​(T initialized,
                                                     FieldDescription fieldDescription,
                                                     TypeDescription instrumentedType,
                                                     MethodDescription instrumentedMethod)
        Resolves the stack manipulation to load the value being set.
        Parameters:
        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.
        Returns:
        The stack manipulation to apply.