Interface PropertyDefinition
-
- All Superinterfaces:
Attribute,AttributeDefinition,Comparable<PropertyDefinition>,Element,PropertyElement,Serializable
- All Known Implementing Classes:
PropertyDefinitionImpl
@TypeMetadata(name="PropertyDefinition", description="This type provides information for the definition of any properties", version="1.1.0") @Change(version="1.1.0",description="The type comply with {@link AttributeDefinition} which add \'defaultValue\'") @Change(version="1.0.0",description="First Version") public interface PropertyDefinition extends PropertyElement, Comparable<PropertyDefinition>, AttributeDefinition
Defines a property of an entity or another property, including its constraints and metadata.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAMEThe name of the PropertyDefinition type.static StringREAD_ONLY_PROPERTYThe property name for the 'readonly' flag.static StringVERSIONThe version of this type definition.-
Fields inherited from interface org.gcube.informationsystem.base.reference.Attribute
DEFAULT_VALUE_PROPERTY, DESCRIPTION_PROPERTY, MAX_PROPERTY, MIN_PROPERTY, NAME_PROPERTY, PROPERTY_TYPE_PROPERTY, REGEX_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.base.reference.AttributeDefinition
MANDATORY_PROPERTY, NOT_NULL_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.base.reference.Element
DATETIME_PATTERN, TYPE_PROPERTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectgetDefaultValue()Returns the default value of the attribute.StringgetDescription()Returns the description of the attribute.IntegergetMax()Returns the maximum allowed value for the attribute.IntegergetMin()Returns the minimum allowed value for the attribute.StringgetName()Returns the name of the attribute.StringgetPropertyType()Returns the property type of the attribute as a string.StringgetRegexp()Returns the regular expression used to validate the attribute's value.booleanisMandatory()Checks if the attribute is mandatory.booleanisNotnull()Checks if the attribute's value cannot be null.booleanisReadonly()Checks if the property is read-only.voidsetReadonly(boolean readonly)Sets whether the property is read-only.-
Methods inherited from interface org.gcube.informationsystem.base.reference.Attribute
getPropertyTypeName, setDefaultValue, setDescription, setMax, setMin, setName, setPropertyType, setRegexp
-
Methods inherited from interface org.gcube.informationsystem.base.reference.AttributeDefinition
setMandatory, setNotnull
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.gcube.informationsystem.base.reference.Element
getTypeName
-
-
-
-
Field Detail
-
NAME
static final String NAME
The name of the PropertyDefinition type.- See Also:
- Constant Field Values
-
VERSION
static final String VERSION
The version of this type definition.- See Also:
- Constant Field Values
-
READ_ONLY_PROPERTY
static final String READ_ONLY_PROPERTY
The property name for the 'readonly' flag.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
@ISProperty(name="name", readonly=true, mandatory=true, nullable=false) String getName()
Returns the name of the attribute.
-
getDescription
@ISProperty(name="description", readonly=false, mandatory=true, nullable=false) String getDescription()
Returns the description of the attribute.- Specified by:
getDescriptionin interfaceAttribute- Returns:
- The attribute's description.
-
isMandatory
@ISProperty(name="mandatory", readonly=false, mandatory=true, nullable=false, defaultValue="false") boolean isMandatory()
Checks if the attribute is mandatory.- Specified by:
isMandatoryin interfaceAttributeDefinition- Returns:
trueif the attribute is mandatory,falseotherwise.
-
isReadonly
@ISProperty(name="readonly", readonly=false, mandatory=true, nullable=false, defaultValue="false") boolean isReadonly()
Checks if the property is read-only.- Returns:
trueif the property is read-only,falseotherwise.
-
setReadonly
void setReadonly(boolean readonly)
Sets whether the property is read-only.- Parameters:
readonly-trueto make the property read-only.
-
isNotnull
@ISProperty(name="notnull", readonly=false, mandatory=true, nullable=false, defaultValue="false") boolean isNotnull()
Checks if the attribute's value cannot be null.- Specified by:
isNotnullin interfaceAttributeDefinition- Returns:
trueif the attribute value must not be null,falseotherwise.
-
getMax
@ISProperty(name="max", readonly=false, mandatory=true, nullable=false) Integer getMax()
Returns the maximum allowed value for the attribute.
-
getMin
@ISProperty(name="min", readonly=false, mandatory=true, nullable=false) Integer getMin()
Returns the minimum allowed value for the attribute.
-
getRegexp
@ISProperty(name="regexp", readonly=false, mandatory=true, nullable=false) String getRegexp()
Returns the regular expression used to validate the attribute's value.
-
getPropertyType
@ISProperty(name="propertyType", readonly=false, mandatory=true, nullable=false) String getPropertyType()
Returns the property type of the attribute as a string.- Specified by:
getPropertyTypein interfaceAttribute- Returns:
- The property type.
-
getDefaultValue
@ISProperty(name="defaultValue", readonly=false, mandatory=false, nullable=true) Object getDefaultValue()
Returns the default value of the attribute.- Specified by:
getDefaultValuein interfaceAttribute- Returns:
- The default value.
-
-