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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe property name for the attribute's default value.static final StringThe property name for the attribute's description.static final StringThe property name for the attribute's maximum value constraint.static final StringThe property name for the attribute's minimum value constraint.static final StringThe name of the attribute type.static final StringThe property name for the attribute's name.static final StringThe property name for the attribute's property type.static final StringThe property name for the attribute's regular expression constraint. -
Method Summary
Modifier and TypeMethodDescriptionReturns the default value of the attribute.Returns the description of the attribute.getMax()Returns the maximum allowed value for the attribute.getMin()Returns the minimum allowed value for the attribute.getName()Returns the name of the attribute.Returns the property type of the attribute as a string.Returns the property type as aPropertyTypeNameenum.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.voidSets the maximum allowed value for the attribute.voidSets the minimum allowed value for the attribute.voidSets the name of the attribute.voidsetPropertyType(String type) Sets the property type of the attribute.voidSets the regular expression for validating the attribute's value.
-
Field Details
-
NAME
The name of the attribute type.- See Also:
-
NAME_PROPERTY
The property name for the attribute's name.- See Also:
-
DESCRIPTION_PROPERTY
The property name for the attribute's description.- See Also:
-
MAX_PROPERTY
The property name for the attribute's maximum value constraint.- See Also:
-
MIN_PROPERTY
The property name for the attribute's minimum value constraint.- See Also:
-
REGEX_PROPERTY
The property name for the attribute's regular expression constraint.- See Also:
-
PROPERTY_TYPE_PROPERTY
The property name for the attribute's property type.- See Also:
-
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
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
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
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
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
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
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
Sets the regular expression for validating the attribute's value.- Parameters:
regexp- The regular expression to set.
-