Class CsvResourceConnectionTemplate


public final class CsvResourceConnectionTemplate extends ResourceConnectionTemplate
Template that may be used to create a data source implementation for a resource connection with CSV metadata.
Since:
8.3
Author:
Jon van Leuven
  • Constructor Details

    • CsvResourceConnectionTemplate

      protected CsvResourceConnectionTemplate(com.aquima.interactions.foundation.report.IInitializationReport report, String name)
  • Method Details

    • addColumnInfo

      public void addColumnInfo(com.aquima.interactions.foundation.DataType type)
      This method adds column info with a specific data type.
      Parameters:
      type - The data type of the column.
    • addColumnInfo

      public void addColumnInfo(com.aquima.interactions.foundation.DataType type, String formatPattern, String formatLocaleCode)
      This method adds column info with an inline formatter.
      Parameters:
      type - The data type of the column.
      formatPattern - The pattern of the the format.
      formatLocaleCode - The locale of the the format.
    • addColumnInfo

      public void addColumnInfo(com.aquima.interactions.foundation.DataType type, String valueFormatName)
      This method adds column info with an available value formatter.
      Parameters:
      type - The data type of the column.
      valueFormatName - The name of the value format to use for this column.
    • setIsFixedWidthText

      public void setIsFixedWidthText(boolean isFixedWidthText)
      This method sets if the resource should be parsed as a fixed width text resource.
      Parameters:
      isFixedWidthText - if the resource should be parsed as a fixed width text resource.
    • setColumnWidths

      public void setColumnWidths(int... columnWidths)
      This method sets the column widths for a fixed width text resource.
      Parameters:
      columnWidths - the column widths for a fixed width text resource.
    • setDelimiter

      public void setDelimiter(char delimiter)
      This method sets the delimiter to use for separating entries.
      Parameters:
      delimiter - the delimiter to use for separating entries.
    • setQuoteCharacter

      public void setQuoteCharacter(char quoteCharacter)
      This method sets the character to use for quoted elements.
      Parameters:
      quoteCharacter - the character to use for quoted elements.
    • setHasRowHeaders

      public void setHasRowHeaders(boolean hasRowHeaders)
      This method sets if the CSV resource's first row contains the headers.
      Parameters:
      hasRowHeaders - if the CSV resource's first row contains the headers.
    • setCsvContent

      public void setCsvContent(String csvContent)
      This method sets the csv content to this resource.
      Parameters:
      csvContent - The csv content, may not be null.
    • toDataSource

      public com.aquima.interactions.project.ds.IResourceConnectionDS toDataSource()
      This method converts the template to a data source that can be used to initialize the definition.
      Overrides:
      toDataSource in class ResourceConnectionTemplate
      Returns:
      a data source that can be used to initialize the definition.
    • getBuilder

      protected com.aquima.interactions.framework.util.CsvMetadataBuilder getBuilder()