Class FieldAccessor.ForSetter.OfConstantValue

    • Field Detail

      • stackManipulation

        private final StackManipulation stackManipulation
        A stack manipulation to load the constant value.
    • Constructor Detail

      • OfConstantValue

        protected OfConstantValue​(FieldAccessor.FieldLocation fieldLocation,
                                  Assigner assigner,
                                  Assigner.Typing typing,
                                  FieldAccessor.ForSetter.TerminationHandler terminationHandler,
                                  TypeDescription.Generic typeDescription,
                                  StackManipulation stackManipulation)
        Creates a setter instrumentation for setting a constant 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.
        typeDescription - The value's type.
        stackManipulation - A stack manipulation to load the constant value.
    • Method Detail

      • prepare

        public InstrumentedType prepare​(InstrumentedType instrumentedType)
        Prepares a given instrumented type.
        Parameters:
        instrumentedType - The instrumented type in its current form.
        Returns:
        The prepared instrumented type.
      • initialize

        protected java.lang.Void initialize​(TypeDescription instrumentedType)
        Initializes a value to be used during method instrumentation.
        Specified by:
        initialize in class FieldAccessor.ForSetter<java.lang.Void>
        Parameters:
        instrumentedType - The instrumented type.
        Returns:
        The initialized value.
      • resolve

        protected StackManipulation resolve​(java.lang.Void unused,
                                            FieldDescription fieldDescription,
                                            TypeDescription instrumentedType,
                                            MethodDescription instrumentedMethod)
        Resolves the stack manipulation to load the value being set.
        Specified by:
        resolve in class FieldAccessor.ForSetter<java.lang.Void>
        Parameters:
        unused - 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

        public Implementation andThen​(Implementation implementation)
        Appends the supplied implementation to this implementation.
        Parameters:
        implementation - The subsequent implementation.
        Returns:
        An implementation that combines this implementation with the provided one.
      • andThen

        public Implementation.Composable andThen​(Implementation.Composable implementation)
        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.