All Implemented Interfaces:
Serializable, Attribute, Element, PropertyElement, SchemaMixedElement, ModelElement, Property, TemplateVariable

public class TemplateVariableImpl extends PropertyElementImpl implements TemplateVariable
The default implementation of the TemplateVariable interface.
Author:
Luca Frosini (ISTI - CNR)
See Also:
  • Field Details

    • name

      protected String name
      The name of the variable.
    • description

      protected String description
      The description of the variable.
    • defaultValue

      protected Object defaultValue
      The default value of the variable.
  • Constructor Details

    • TemplateVariableImpl

      public TemplateVariableImpl()
      Default constructor.
  • Method Details

    • getName

      public String getName()
      Returns the name of the attribute.
      Specified by:
      getName in interface Attribute
      Specified by:
      getName in interface TemplateVariable
      Returns:
      The attribute's name.
    • setName

      public void setName(String name)
      Sets the name of the attribute.
      Specified by:
      setName in interface Attribute
      Parameters:
      name - The name to set.
    • getDescription

      public String getDescription()
      Returns the description of the attribute.
      Specified by:
      getDescription in interface Attribute
      Specified by:
      getDescription in interface TemplateVariable
      Returns:
      The attribute's description.
    • setDescription

      public void setDescription(String description)
      Sets the description of the attribute.
      Specified by:
      setDescription in interface Attribute
      Parameters:
      description - The description to set.
    • getMax

      public Integer getMax()
      Returns the maximum allowed value for the attribute.
      Specified by:
      getMax in interface Attribute
      Specified by:
      getMax in interface TemplateVariable
      Returns:
      The maximum value, or null if not set.
    • setMax

      public void setMax(Integer max)
      Sets the maximum allowed value for the attribute.
      Specified by:
      setMax in interface Attribute
      Parameters:
      max - The maximum value to set.
    • getMin

      public Integer getMin()
      Returns the minimum allowed value for the attribute.
      Specified by:
      getMin in interface Attribute
      Specified by:
      getMin in interface TemplateVariable
      Returns:
      The minimum value, or null if not set.
    • setMin

      public void setMin(Integer min)
      Sets the minimum allowed value for the attribute.
      Specified by:
      setMin in interface Attribute
      Parameters:
      min - The minimum value to set.
    • getRegexp

      public String getRegexp()
      Returns the regular expression used to validate the attribute's value.
      Specified by:
      getRegexp in interface Attribute
      Specified by:
      getRegexp in interface TemplateVariable
      Returns:
      The regular expression, or null if not set.
    • setRegexp

      public void setRegexp(String regexp)
      Sets the regular expression for validating the attribute's value.
      Specified by:
      setRegexp in interface Attribute
      Parameters:
      regexp - The regular expression to set.
    • getPropertyType

      public String getPropertyType()
      Returns the property type of the attribute as a string.
      Specified by:
      getPropertyType in interface Attribute
      Specified by:
      getPropertyType in interface TemplateVariable
      Returns:
      The property type.
    • setPropertyType

      public void setPropertyType(String type)
      Sets the property type.
      Specified by:
      setPropertyType in interface Attribute
      Parameters:
      type - the type
    • getPropertyTypeName

      public PropertyTypeName getPropertyTypeName()
      Gets the property type name.
      Specified by:
      getPropertyTypeName in interface Attribute
      Returns:
      the property type name
    • getDefaultValue

      public Object getDefaultValue()
      Returns the default value of the attribute.
      Specified by:
      getDefaultValue in interface Attribute
      Specified by:
      getDefaultValue in interface TemplateVariable
      Returns:
      The default value.
    • setDefaultValue

      public void setDefaultValue(Object defaultValue)
      Sets the default value of the attribute.
      Specified by:
      setDefaultValue in interface Attribute
      Parameters:
      defaultValue - The default value to set.
    • toString

      public String toString()
      Returns a JSON representation of the element.
      Overrides:
      toString in class ElementImpl
      Returns:
      The JSON string representation of the object.