Class CsvResourceConnectionTemplate
java.lang.Object
com.aquima.interactions.test.templates.AbstractReportingTemplate
com.aquima.interactions.test.templates.project.ResourceConnectionTemplate
com.aquima.interactions.test.templates.project.CsvResourceConnectionTemplate
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 Summary
ConstructorsModifierConstructorDescriptionprotected
CsvResourceConnectionTemplate
(com.aquima.interactions.foundation.report.IInitializationReport report, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addColumnInfo
(com.aquima.interactions.foundation.DataType type) This method adds column info with a specific data type.void
addColumnInfo
(com.aquima.interactions.foundation.DataType type, String valueFormatName) This method adds column info with an available value formatter.void
addColumnInfo
(com.aquima.interactions.foundation.DataType type, String formatPattern, String formatLocaleCode) This method adds column info with an inline formatter.protected com.aquima.interactions.framework.util.CsvMetadataBuilder
void
setColumnWidths
(int... columnWidths) This method sets the column widths for a fixed width text resource.void
setCsvContent
(String csvContent) This method sets the csv content to this resource.void
setDelimiter
(char delimiter) This method sets the delimiter to use for separating entries.void
setHasRowHeaders
(boolean hasRowHeaders) This method sets if the CSV resource's first row contains the headers.void
setIsFixedWidthText
(boolean isFixedWidthText) This method sets if the resource should be parsed as a fixed width text resource.void
setQuoteCharacter
(char quoteCharacter) This method sets the character to use for quoted elements.com.aquima.interactions.project.ds.IResourceConnectionDS
This method converts the template to a data source that can be used to initialize the definition.Methods inherited from class com.aquima.interactions.test.templates.project.ResourceConnectionTemplate
getBase64EncodedData, getName, getParameters, setParameter, setTextContent
Methods inherited from class com.aquima.interactions.test.templates.AbstractReportingTemplate
getInitializationReport
-
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
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
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 classResourceConnectionTemplate
- Returns:
- a data source that can be used to initialize the definition.
-
getBuilder
protected com.aquima.interactions.framework.util.CsvMetadataBuilder getBuilder()
-