Interface Attribute
-
- All Known Subinterfaces:
AttributeDefinition,PropertyDefinition,TemplateVariable
- All Known Implementing Classes:
PropertyDefinitionImpl,TemplateVariableImpl
public interface AttributeDefines 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 Summary
Fields Modifier and Type Field Description static StringDEFAULT_VALUE_PROPERTYThe property name for the attribute's default value.static StringDESCRIPTION_PROPERTYThe property name for the attribute's description.static StringMAX_PROPERTYThe property name for the attribute's maximum value constraint.static StringMIN_PROPERTYThe property name for the attribute's minimum value constraint.static StringNAMEThe name of the attribute type.static StringNAME_PROPERTYThe property name for the attribute's name.static StringPROPERTY_TYPE_PROPERTYThe property name for the attribute's property type.static StringREGEX_PROPERTYThe property name for the attribute's regular expression constraint.
-
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.PropertyTypeNamegetPropertyTypeName()Returns the property type as aPropertyTypeNameenum.StringgetRegexp()Returns the regular expression used to validate the attribute's value.voidsetDefaultValue(Object defaultValue)Sets the default value of the attribute.voidsetDescription(String description)Sets the description of the attribute.voidsetMax(Integer max)Sets the maximum allowed value for the attribute.voidsetMin(Integer min)Sets the minimum allowed value for the attribute.voidsetName(String name)Sets the name of the attribute.voidsetPropertyType(String type)Sets the property type of the attribute.voidsetRegexp(String regexp)Sets the regular expression for validating the attribute's value.
-
-
-
Field Detail
-
NAME
static final String NAME
The name of the attribute type.- See Also:
- Constant Field Values
-
NAME_PROPERTY
static final String NAME_PROPERTY
The property name for the attribute's name.- See Also:
- Constant Field Values
-
DESCRIPTION_PROPERTY
static final String DESCRIPTION_PROPERTY
The property name for the attribute's description.- See Also:
- Constant Field Values
-
MAX_PROPERTY
static final String MAX_PROPERTY
The property name for the attribute's maximum value constraint.- See Also:
- Constant Field Values
-
MIN_PROPERTY
static final String MIN_PROPERTY
The property name for the attribute's minimum value constraint.- See Also:
- Constant Field Values
-
REGEX_PROPERTY
static final String REGEX_PROPERTY
The property name for the attribute's regular expression constraint.- See Also:
- Constant Field Values
-
PROPERTY_TYPE_PROPERTY
static final String PROPERTY_TYPE_PROPERTY
The property name for the attribute's property type.- See Also:
- Constant Field Values
-
DEFAULT_VALUE_PROPERTY
static final String DEFAULT_VALUE_PROPERTY
The property name for the attribute's default value.- See Also:
- Constant Field Values
-
-
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.
-
getPropertyTypeName
PropertyTypeName getPropertyTypeName()
Returns the property type as aPropertyTypeNameenum.This method is ignored during JSON serialization.
- Returns:
- The
PropertyTypeNameenum 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
nullif 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
nullif 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
nullif not set.
-
setRegexp
void setRegexp(String regexp)
Sets the regular expression for validating the attribute's value.- Parameters:
regexp- The regular expression to set.
-
-