Interface MutableFieldDeclaration

    • Method Detail

      • setFinal

        void setFinal​(boolean isFinal)
        sets the 'final' property
        Parameters:
        isFinal -
      • setStatic

        void setStatic​(boolean isStatic)
        sets the 'static' property
        Parameters:
        isStatic -
      • setTransient

        void setTransient​(boolean isTransient)
        sets the 'transient' property
        Parameters:
        isTransient -
      • setVolatile

        void setVolatile​(boolean isVolatile)
        sets the 'volatile' property
        Parameters:
        isVolatile -
      • setInitializer

        void setInitializer​(Expression initializer)
        sets the 'initializer' expression of this field declaration. Automatically detaches any previously assigned initializers from this field declaration. If the given expression is assigned to another MutableExecutableDeclaration or MutableFieldDeclaration, it will be detached from there as well.
        Parameters:
        initializer -
      • setInitializer

        void setInitializer​(CompilationStrategy initializer)
        sets the 'initializer' expression of this field declaration. Automatically detaches any previously assigned initializers from this field declaration. The given CompilationStrategy will be executed later during code generation, not immediately.
        Parameters:
        initializer - the compilation strategy, must not be null
        Throws:
        java.lang.IllegalArgumentException - if the initializer is null
      • setInitializer

        void setInitializer​(org.eclipse.xtend2.lib.StringConcatenationClient template)
        sets the 'initializer' expression of this field declaration. Automatically detaches any previously assigned initializers from this field declaration. The given StringConcatenationClient will be executed later during code generation, not immediately.
        Parameters:
        template - the compilation template, must not be null
        Throws:
        java.lang.IllegalArgumentException - if the initializer is null
      • setConstantValueAsLong

        void setConstantValueAsLong​(long value)
        sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'
        Parameters:
        value - the constant value
        Since:
        2.8
      • setConstantValueAsInt

        void setConstantValueAsInt​(int value)
        sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'
        Parameters:
        value - the constant value
        Since:
        2.8
      • setConstantValueAsShort

        void setConstantValueAsShort​(short value)
        sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'
        Parameters:
        value - the constant value
        Since:
        2.8
      • setConstantValueAsByte

        void setConstantValueAsByte​(byte value)
        sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'
        Parameters:
        value - the constant value
        Since:
        2.8
      • setConstantValueAsDouble

        void setConstantValueAsDouble​(double value)
        sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'
        Parameters:
        value - the constant value
        Since:
        2.8
      • setConstantValueAsFloat

        void setConstantValueAsFloat​(float value)
        sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'
        Parameters:
        value - the constant value
        Since:
        2.8
      • setConstantValueAsChar

        void setConstantValueAsChar​(char value)
        sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'
        Parameters:
        value - the constant value
        Since:
        2.8
      • setConstantValueAsBoolean

        void setConstantValueAsBoolean​(boolean value)
        sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'
        Parameters:
        value - the constant value
        Since:
        2.8
      • setConstantValueAsString

        void setConstantValueAsString​(java.lang.String value)
        sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'
        Parameters:
        value - the constant value, must not be null
        Throws:
        java.lang.IllegalArgumentException - if the value is null
        Since:
        2.8
      • markAsInitializedBy

        void markAsInitializedBy​(ConstructorDeclaration constructorDeclaration)
        Indicate that this field is properly initialized by the given constructor.
        Parameters:
        constructorDeclaration - a constructor that initializes this field
        Since:
        2.7
      • setType

        void setType​(TypeReference type)
        sets the 'type' of this field declaration
        Parameters:
        type - the type, must be not null
        Throws:
        java.lang.IllegalArgumentException - if the type is nulll