Interface TemplateVariable
-
- All Superinterfaces:
Attribute,Element,PropertyElement,Serializable
- All Known Implementing Classes:
TemplateVariableImpl
@TypeMetadata(name="TemplateVariable", description="Defines a variable used within a Query Template, including its name, type, constraints, and default value.", version="2.0.0") @Change(version="2.0.0",description="\'min\' and \'max\' are optional; \'regexp\' is always present, empty for no pattern. Added \'required\'.") @Change(version="1.1.0",description="The type comply with [Attribute](type:Attribute) which add \'defaultValue\'") @Change(version="1.0.0",description="First Version") public interface TemplateVariable extends PropertyElement, Attribute
Defines a variable used within aQueryTemplate.This interface extends
Attributeto provide the full definition of a variable, including its name, type, constraints, and default value.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAMEThe name of the TemplateVariable property type.static StringREQUIRED_PROPERTYThe property name for the variable's requiredness.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.Element
DATETIME_PATTERN, REDACTED, TYPE_PROPERTY, UNKNOWN_USER
-
-
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 upper bound of the attribute.IntegergetMin()Returns the lower bound of 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.booleanisRequired()Indicates whether the execution payload must supply this variable.voidsetRequired(boolean required)Sets whether the execution payload must supply this variable.-
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.Element
getTypeName
-
-
-
-
Field Detail
-
NAME
static final String NAME
The name of the TemplateVariable property type.- See Also:
- Constant Field Values
-
VERSION
static final String VERSION
The version of this type definition.- See Also:
- Constant Field Values
-
REQUIRED_PROPERTY
static final String REQUIRED_PROPERTY
The property name for the variable's requiredness.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
@ISProperty(name="name", description="The name of the Query Template Variable.", readonly=true, mandatory=true) String getName()
Returns the name of the attribute.
-
getDescription
@ISProperty(name="description", readonly=false, mandatory=true) String getDescription()
Returns the description of the attribute.- Specified by:
getDescriptionin interfaceAttribute- Returns:
- The attribute's description.
-
getMax
@ISProperty(name="max", readonly=false, mandatory=false) Integer getMax()
Returns the upper bound of the attribute.The bound is an integer, unless the attribute admits a decimal one: a
PropertyDefinitionwhose base type isDoubleorFloat.
-
getMin
@ISProperty(name="min", readonly=false, mandatory=false) Integer getMin()
Returns the lower bound of the attribute.The bound is an integer, unless the attribute admits a decimal one: a
PropertyDefinitionwhose base type isDoubleorFloat.
-
getRegexp
@ISProperty(name="regexp", readonly=false, mandatory=true, defaultValue="") String getRegexp()
Returns the regular expression used to validate the attribute's value.
-
getPropertyType
@ISProperty(name="propertyType", readonly=false, mandatory=true) 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) Object getDefaultValue()
Returns the default value of the attribute.- Specified by:
getDefaultValuein interfaceAttribute- Returns:
- The default value.
-
isRequired
@ISProperty(name="required", readonly=false, mandatory=false, defaultValue="false") boolean isRequired()
Indicates whether the execution payload must supply this variable. Whenfalse, an omitted variable takes its default value.- Returns:
trueif the variable is required at execution time.
-
setRequired
void setRequired(boolean required)
Sets whether the execution payload must supply this variable.- Parameters:
required-trueif the variable is required at execution time.
-
-