public class FieldTemplate extends ElementTemplate
Template that can be used to initialize a field definition.
Since:
6.0
Author:
O. Kerpershoek
  • Constructor Details

    • FieldTemplate

      protected FieldTemplate(com.aquima.interactions.foundation.report.IInitializationReport report, AttributeTemplate attribute)
    • FieldTemplate

      protected FieldTemplate(com.aquima.interactions.foundation.report.IInitializationReport report, String fieldName)
  • Method Details

    • setRequired

      public void setRequired(boolean isRequired)
      This method may be used to specify if the field is required to be filled by the client.
      Parameters:
      isRequired - Boolean indicating if the field is required to be filled by the client.
    • getRequiredCondition

      protected String getRequiredCondition()
    • setRequiredCondition

      public void setRequiredCondition(String condition)
      This method may be used to override the required condition of the reference.
      Parameters:
      condition - The required condition that should be used to determine if the field is required.
    • getQuestionText

      protected com.aquima.interactions.foundation.text.IMultilingualText getQuestionText()
    • setQuestionText

      public void setQuestionText(String text)
      This method may be used to override the question text of the field.
      Parameters:
      text - the question text of the field.
    • setQuestionText

      public void setQuestionText(com.aquima.interactions.foundation.text.IMultilingualText text)
      This method may be used to override the question text of the field.
      Parameters:
      text - the question text of the field.
      Since:
      8.4
    • getExplainText

      protected com.aquima.interactions.foundation.text.IMultilingualText getExplainText()
    • setExplainText

      public void setExplainText(com.aquima.interactions.foundation.text.IMultilingualText text)
      This method may be used to override the explain text of the field.
      Parameters:
      text - the explain text of the field.
      Since:
      8.4
    • setExplainText

      public void setExplainText(String text)
      This method may be used to override the explain text of the field.
      Parameters:
      text - the explain text of the field.
    • isMultivalue

      protected boolean isMultivalue()
    • getDataType

      protected com.aquima.interactions.foundation.DataType getDataType()
    • addValidation

      public FieldValidationTemplate addValidation(String type)
      This method may be used to add a validation to the field.
      Parameters:
      type - The type of the validation that should be added.
      Returns:
      Template representing the newly added validation.
    • getValidations

      protected List<FieldValidationTemplate> getValidations()
    • addPrimitiveParameter

      public GlobalParameterValueTemplate addPrimitiveParameter(String parameterName, com.aquima.interactions.foundation.DataType primitiveType, String expression)
      This method can be used to add a primitive parameter value to this field. A global parameter with the given name should be defined in the project, should be of primitive type and the primitive data type should match the given data type.
      Parameters:
      parameterName - the name of the primitive parameter
      primitiveType - the data type of the primitive parameter
      expression - the expression used to obtain the value (should evaluate to the given data type)
    • addTextParameter

      public GlobalParameterValueTemplate addTextParameter(String parameterName, String contentItem)
      This method can be used to add a text parameter value to this field. A global parameter with the given name should be defined in the project and should be of type text. A content item with the given name should also be defined in the composer.
      Parameters:
      parameterName - the name of the parameter
      contentItem - the content item
    • getParameters

      protected List<GlobalParameterValueTemplate> getParameters()
    • toDataSource

      public com.aquima.interactions.composer.ds.IFieldDS toDataSource()
      This method converts the template to a data source that can be used to initialize a field definition.
      Returns:
      a data source that can be used to initialize a field definition.