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 a QueryTemplate.

This interface extends Attribute to provide the full definition of a variable, including its name, type, constraints, and default value.

Author:
Luca Frosini (ISTI - CNR)
  • Field Details

  • Method Details

    • getName

      @ISProperty(name="name", description="The name of the Query Template Variable.", readonly=true, mandatory=true) String getName()
      Returns the name of the attribute.
      Specified by:
      getName in interface Attribute
      Returns:
      The attribute's name.
    • getDescription

      @ISProperty(name="description", readonly=false, mandatory=true) String getDescription()
      Returns the description of the attribute.
      Specified by:
      getDescription in interface Attribute
      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 PropertyDefinition whose base type is Double or Float.

      Specified by:
      getMax in interface Attribute
      Returns:
      The upper bound, or null if not set.
    • 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 PropertyDefinition whose base type is Double or Float.

      Specified by:
      getMin in interface Attribute
      Returns:
      The lower bound, or null if not set.
    • getRegexp

      @ISProperty(name="regexp", readonly=false, mandatory=true, defaultValue="") String getRegexp()
      Returns the regular expression used to validate the attribute's value.
      Specified by:
      getRegexp in interface Attribute
      Returns:
      The regular expression, or null if not set.
    • getPropertyType

      @ISProperty(name="propertyType", readonly=false, mandatory=true) String getPropertyType()
      Returns the property type of the attribute as a string.
      Specified by:
      getPropertyType in interface Attribute
      Returns:
      The property type.
    • getDefaultValue

      @ISProperty(name="defaultValue", readonly=false, mandatory=false) Object getDefaultValue()
      Returns the default value of the attribute.
      Specified by:
      getDefaultValue in interface Attribute
      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. When false, an omitted variable takes its default value.
      Returns:
      true if the variable is required at execution time.
    • setRequired

      void setRequired(boolean required)
      Sets whether the execution payload must supply this variable.
      Parameters:
      required - true if the variable is required at execution time.