Interface Attribute

  • All Known Subinterfaces:
    AttributeDefinition, PropertyDefinition, TemplateVariable
    All Known Implementing Classes:
    PropertyDefinitionImpl, TemplateVariableImpl

    public interface Attribute
    Defines the contract for an attribute, which represents a characteristic of an entity or property.

    An attribute has a name, description, type, and optional constraints such as minimum/maximum values and a regular expression for validation. It can also have a default value.

    Author:
    Luca Frosini (ISTI - CNR)
    • Method Detail

      • getName

        String getName()
        Returns the name of the attribute.
        Returns:
        The attribute's name.
      • setName

        void setName​(String name)
        Sets the name of the attribute.
        Parameters:
        name - The name to set.
      • getDescription

        String getDescription()
        Returns the description of the attribute.
        Returns:
        The attribute's description.
      • setDescription

        void setDescription​(String description)
        Sets the description of the attribute.
        Parameters:
        description - The description to set.
      • getPropertyType

        String getPropertyType()
        Returns the property type of the attribute as a string.
        Returns:
        The property type.
      • setPropertyType

        void setPropertyType​(String type)
        Sets the property type of the attribute.
        Parameters:
        type - The property type to set.
      • getDefaultValue

        Object getDefaultValue()
        Returns the default value of the attribute.
        Returns:
        The default value.
      • setDefaultValue

        void setDefaultValue​(Object defaultValue)
        Sets the default value of the attribute.
        Parameters:
        defaultValue - The default value to set.
      • getMax

        Number getMax()
        Returns the upper bound of the attribute.

        The bound is an integer, unless the attribute admits a decimal one: a PropertyDefinition whose base type is Double or Float.

        Returns:
        The upper bound, or null if not set.
      • setMax

        void setMax​(Number max)
        Sets the upper bound of the attribute.
        Parameters:
        max - The upper bound to set, null for none.
      • getMin

        Number getMin()
        Returns the lower bound of the attribute.

        The bound is an integer, unless the attribute admits a decimal one: a PropertyDefinition whose base type is Double or Float.

        Returns:
        The lower bound, or null if not set.
      • setMin

        void setMin​(Number min)
        Sets the lower bound of the attribute.
        Parameters:
        min - The lower bound to set, null for none.
      • getRegexp

        String getRegexp()
        Returns the regular expression used to validate the attribute's value.
        Returns:
        The regular expression, or null if not set.
      • setRegexp

        void setRegexp​(String regexp)
        Sets the regular expression for validating the attribute's value.
        Parameters:
        regexp - The regular expression to set.