Class MemberSubstitution.Substitution.ForValue

    • Field Detail

      • stackManipulation

        private final StackManipulation stackManipulation
        The stack manipulation to load the value that represents the substitution.
      • typeDescription

        private final TypeDescription.Generic typeDescription
        The type of the represented stack manipulation.
    • Constructor Detail

      • ForValue

        public ForValue​(StackManipulation stackManipulation,
                        TypeDescription.Generic typeDescription)
        Creates a new substitution for loading a constant value.
        Parameters:
        stackManipulation - The stack manipulation to load the value that represents the substitution.
        typeDescription - The type of the represented stack manipulation.
    • Method Detail

      • resolve

        public StackManipulation resolve​(TypeDescription receiver,
                                         ByteCodeElement.Member original,
                                         TypeList.Generic parameters,
                                         TypeDescription.Generic result,
                                         JavaConstant.MethodHandle methodHandle,
                                         StackManipulation stackManipulation,
                                         int freeOffset)
        Resolves this substitution into a stack manipulation.
        Specified by:
        resolve in interface MemberSubstitution.Substitution
        Parameters:
        receiver - The target type on which a member is accessed.
        original - The field, method or constructor that is substituted.
        parameters - All parameters that serve as input to this access.
        result - The result that is expected from the interaction or void if no result is expected.
        methodHandle - A method handle describing the substituted expression.
        stackManipulation - The original byte code expression that is being executed.
        freeOffset - The first free offset of the local variable array that can be used for storing values.
        Returns:
        A stack manipulation that represents the access.