Class PropertyDefinitionImpl

    • Field Detail

      • URI_REGEX

        public static final String URI_REGEX
        The regex for URIs.
      • URL_REGEX

        public static final String URL_REGEX
        The regex for URLs.
    • Constructor Detail

      • PropertyDefinitionImpl

        protected PropertyDefinitionImpl()
        Default constructor.
      • PropertyDefinitionImpl

        public PropertyDefinitionImpl​(ISProperty propertyAnnotation,
                                      Method method)
        Constructs a new PropertyDefinitionImpl from an annotation and a method.
        Parameters:
        propertyAnnotation - the annotation
        method - the method
    • Method Detail

      • setName

        public void setName​(String name)
        Sets the name of the attribute.
        Specified by:
        setName in interface Attribute
        Parameters:
        name - The name to set.
      • setDescription

        public void setDescription​(String description)
        Sets the description of the attribute.
        Specified by:
        setDescription in interface Attribute
        Parameters:
        description - The description to set.
      • setMandatory

        public void setMandatory​(boolean mandatory)
        Sets whether the attribute is mandatory.
        Specified by:
        setMandatory in interface AttributeDefinition
        Parameters:
        mandatory - true to make the attribute mandatory, false otherwise.
      • isReadonly

        public boolean isReadonly()
        Checks if the property is read-only.
        Specified by:
        isReadonly in interface PropertyDefinition
        Returns:
        true if the property is read-only, false otherwise.
      • setReadonly

        public void setReadonly​(boolean readonly)
        Sets whether the property is read-only.
        Specified by:
        setReadonly in interface PropertyDefinition
        Parameters:
        readonly - true to make the property read-only.
      • isNotnull

        public boolean isNotnull()
        Checks if the attribute's value cannot be null.
        Specified by:
        isNotnull in interface AttributeDefinition
        Specified by:
        isNotnull in interface PropertyDefinition
        Returns:
        true if the attribute value must not be null, false otherwise.
      • setNotnull

        public void setNotnull​(boolean notnull)
        Sets whether the attribute's value can be null.
        Specified by:
        setNotnull in interface AttributeDefinition
        Parameters:
        notnull - true to enforce a non-null value, false otherwise.
      • getMax

        public Integer getMax()
        Returns the maximum allowed value for the attribute.
        Specified by:
        getMax in interface Attribute
        Specified by:
        getMax in interface PropertyDefinition
        Returns:
        The maximum value, or null if not set.
      • setMax

        public void setMax​(Integer max)
        Sets the maximum allowed value for the attribute.
        Specified by:
        setMax in interface Attribute
        Parameters:
        max - The maximum value to set.
      • getMin

        public Integer getMin()
        Returns the minimum allowed value for the attribute.
        Specified by:
        getMin in interface Attribute
        Specified by:
        getMin in interface PropertyDefinition
        Returns:
        The minimum value, or null if not set.
      • setMin

        public void setMin​(Integer min)
        Sets the minimum allowed value for the attribute.
        Specified by:
        setMin in interface Attribute
        Parameters:
        min - The minimum value to set.
      • getRegexp

        public String getRegexp()
        Returns the regular expression used to validate the attribute's value.
        Specified by:
        getRegexp in interface Attribute
        Specified by:
        getRegexp in interface PropertyDefinition
        Returns:
        The regular expression, or null if not set.
      • setRegexp

        public void setRegexp​(String regexp)
        Sets the regular expression for validating the attribute's value.
        Specified by:
        setRegexp in interface Attribute
        Parameters:
        regexp - The regular expression to set.
      • setPropertyType

        public void setPropertyType​(String type)
        Sets the property type.
        Specified by:
        setPropertyType in interface Attribute
        Parameters:
        type - the type
      • setDefaultValue

        public void setDefaultValue​(Object defaultValue)
        Sets the default value of the attribute.
        Specified by:
        setDefaultValue in interface Attribute
        Parameters:
        defaultValue - The default value to set.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • compareIntegers

        protected int compareIntegers​(Integer thisInt,
                                      Integer otherInt)
        Compares two integers.
        Parameters:
        thisInt - the first integer
        otherInt - the second integer
        Returns:
        the result of the comparison
      • getTypeName

        public String getTypeName()
        Returns the name of the element's type. This is typically used for type identification in serialized forms.
        Specified by:
        getTypeName in interface Element
        Returns:
        The type name of the element.