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)
  • Field Details

    • NAME

      static final String NAME
      The name of the attribute type.
      See Also:
    • NAME_PROPERTY

      static final String NAME_PROPERTY
      The property name for the attribute's name.
      See Also:
    • DESCRIPTION_PROPERTY

      static final String DESCRIPTION_PROPERTY
      The property name for the attribute's description.
      See Also:
    • MAX_PROPERTY

      static final String MAX_PROPERTY
      The property name for the attribute's maximum value constraint.
      See Also:
    • MIN_PROPERTY

      static final String MIN_PROPERTY
      The property name for the attribute's minimum value constraint.
      See Also:
    • REGEX_PROPERTY

      static final String REGEX_PROPERTY
      The property name for the attribute's regular expression constraint.
      See Also:
    • PROPERTY_TYPE_PROPERTY

      static final String PROPERTY_TYPE_PROPERTY
      The property name for the attribute's property type.
      See Also:
    • DEFAULT_VALUE_PROPERTY

      static final String DEFAULT_VALUE_PROPERTY
      The property name for the attribute's default value.
      See Also:
  • Method Details

    • 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.
    • getPropertyTypeName

      PropertyTypeName getPropertyTypeName()
      Returns the property type as a PropertyTypeName enum.

      This method is ignored during JSON serialization.

      Returns:
      The PropertyTypeName enum constant.
    • 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

      Integer getMax()
      Returns the maximum allowed value for the attribute.
      Returns:
      The maximum value, or null if not set.
    • setMax

      void setMax(Integer max)
      Sets the maximum allowed value for the attribute.
      Parameters:
      max - The maximum value to set.
    • getMin

      Integer getMin()
      Returns the minimum allowed value for the attribute.
      Returns:
      The minimum value, or null if not set.
    • setMin

      void setMin(Integer min)
      Sets the minimum allowed value for the attribute.
      Parameters:
      min - The minimum value to set.
    • 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.