Class CompoundTypeDescriptor.SlotDescriptor

    • Field Detail

      • modifiers

        private java.util.List<IModifier> modifiers
      • isConstant

        private boolean isConstant
    • Constructor Detail

      • SlotDescriptor

        public SlotDescriptor​(CompoundTypeDescriptor declaringType,
                              VariableDeclaration var)
        Creates a slot descriptor.
        Parameters:
        declaringType - the declaring compound type
        var - the variable declaration representing the variable
    • Method Detail

      • getJavaSignature

        public java.lang.String getJavaSignature()
        Description copied from interface: IMetaField
        Returns the java-like signature of this operation.
        Specified by:
        getJavaSignature in interface IMetaField
        Returns:
        the java-like Java signature of this operation
      • isReadOnly

        public boolean isReadOnly()
        Description copied from interface: IMetaField
        Returns whether the field is read-only. Please note that this method provides a "static" information, i.e., it cannot change during script execution. If a field can be modified at all, this method shall return true and determine when the value is changed, whether the actual access is permitted. In contrast, if it is known that the field cannot be changed at all, this method shall return false.
        Specified by:
        isReadOnly in interface IMetaField
        Returns:
        true if the field is read-only, false else
      • isConstant

        public boolean isConstant()
        Returns whether this slot is constant or not. By default, a slot is always not constant.
        Returns:
        True if this slot is a constant. False otherwise.
      • isStatic

        public boolean isStatic()
        Description copied from interface: IMetaField
        Returns whether the field is static.
        Specified by:
        isStatic in interface IMetaField
        Returns:
        true if the field is static, false else
      • getValue

        public java.lang.Object getValue​(java.lang.Object owner)
                                  throws VilException
        Description copied from class: FieldDescriptor
        Returns the actual value of this field.
        Specified by:
        getValue in class FieldDescriptor
        Parameters:
        owner - the owning object (ignored, i.e., shall be null, if IMetaField.isStatic())
        Returns:
        the actual value
        Throws:
        VilException - in case that retrieving the value fails
      • getModifierCount

        public int getModifierCount()
        Description copied from interface: IModifierHolder
        Returns the number of modifiers.
        Specified by:
        getModifierCount in interface IModifierHolder
        Returns:
        the number of modifiers
      • getModifier

        public IModifier getModifier​(int index)
        Description copied from interface: IModifierHolder
        Returns the specified modifier.
        Specified by:
        getModifier in interface IModifierHolder
        Parameters:
        index - the 0-based index of the modifier to return
        Returns:
        the specified modifier
      • hasModifier

        public boolean hasModifier​(IModifier modifier)
        Description copied from interface: IModifierHolder
        Returns whether this variable declaration has a given modifier.
        Specified by:
        hasModifier in interface IModifierHolder
        Parameters:
        modifier - the modifier to search for
        Returns:
        true if this variable declaration has the modifier attached, false else
      • getExpression

        public Expression getExpression()
        Returns the initialization expression.
        Returns:
        the initialization expression, may be null if there is none