DataSourceCsv class
Package: com.tecit.TFORMer.Repository
Specialized DataSource for CSV data (character separated values).
Usage and notes
Overview
DataSourceCsv is a specialized DataSource for importing data from CSV files.
This class is used to manipulate existing DataSourceCsv objects. To create a new DataSource use TFORMer Designer or Project.addDataSource.
The main properties to characterize a DataSourceCsv are:
The filename
The separator character
This is usually a comma,and separates the single column names (= the names of the DataFields) and column values (= values of DataFields) from each otherThe qualifier character
The qualifier character encloses column-values (e.g."This is a string").Has column names
Specifies if the CSV file contains the DataField names in the first line. If no names are provided TFORMer assumes the namesField_0,Field_1, etc.
Modifying an Existing CSV-DataSource
// Retrieve the global Project
// DataSources are defined in a Project or a global Project
Project project = repository.getGlobalProject ();
// Retrieve the DataSource by name
// Since we know the type of the DataSource, we can cast it to DataSourceCsv
DataSourceCsv dataSource = (DataSourceCsv)project.getDataSource("CSV");
// Modify some DataSource properties
dataSource.setQualifier("'");
dataSource.setSeparator(",");
Inheritance and related types
Base types: DataSource
Inherited members (33)
- com.tecit.TFORMer.Repository.DataSourceCsv.addComputedField
- com.tecit.TFORMer.Repository.DataSourceCsv.addFieldMapping
- com.tecit.TFORMer.Repository.DataSourceCsv.addParameter
- com.tecit.TFORMer.Repository.DataSourceCsv.dispose
- com.tecit.TFORMer.Repository.DataSourceCsv.getComment
- com.tecit.TFORMer.Repository.DataSourceCsv.getComputedField
- com.tecit.TFORMer.Repository.DataSourceCsv.getCopyColumnName
- com.tecit.TFORMer.Repository.DataSourceCsv.getDescription
- com.tecit.TFORMer.Repository.DataSourceCsv.getFieldMapping
- com.tecit.TFORMer.Repository.DataSourceCsv.getFirstComputedField
- com.tecit.TFORMer.Repository.DataSourceCsv.getFirstDSFieldMapping
- com.tecit.TFORMer.Repository.DataSourceCsv.getFirstParameter
- com.tecit.TFORMer.Repository.DataSourceCsv.getName
- com.tecit.TFORMer.Repository.DataSourceCsv.getNext
- com.tecit.TFORMer.Repository.DataSourceCsv.getNumberOfComputedFields
- com.tecit.TFORMer.Repository.DataSourceCsv.getNumberOfFieldMappings
- com.tecit.TFORMer.Repository.DataSourceCsv.getNumberOfParameters
- com.tecit.TFORMer.Repository.DataSourceCsv.getParameter
- com.tecit.TFORMer.Repository.DataSourceCsv.getType
- com.tecit.TFORMer.Repository.DataSourceCsv.isDefault
- com.tecit.TFORMer.Repository.DataSourceCsv.isHandleEscapeSequences
- com.tecit.TFORMer.Repository.DataSourceCsv.removeComputedField
- com.tecit.TFORMer.Repository.DataSourceCsv.removeComputedField
- com.tecit.TFORMer.Repository.DataSourceCsv.removeFieldMapping
- com.tecit.TFORMer.Repository.DataSourceCsv.removeFieldMapping
- com.tecit.TFORMer.Repository.DataSourceCsv.removeParameter
- com.tecit.TFORMer.Repository.DataSourceCsv.removeParameter
- com.tecit.TFORMer.Repository.DataSourceCsv.setComment
- com.tecit.TFORMer.Repository.DataSourceCsv.setCopyColumnName
- com.tecit.TFORMer.Repository.DataSourceCsv.setDescription
- com.tecit.TFORMer.Repository.DataSourceCsv.setHandleEscapeSequences
- com.tecit.TFORMer.Repository.DataSourceCsv.setName
- com.tecit.TFORMer.Repository.DataSourceCsv.toString
Methods
| Member | Description |
|---|---|
| dump(PrintStream) | Dumps the current instance into a text stream. |
| getFilename() | Gets the filename of the CSV file. |
| getQualifier() | Gets the qualifier character that encloses DataField values. |
| getSeparator() | Gets the separator character that separates DataField-names or DataField-values. |
| isHasColumnNames() | Determines if the DataSourceCsv expects column names in the first line of the CSV file. |
| setFilename(String) | Sets the filename of the CSV file. |
| setHasColumnNames(boolean) | Sets the HasColumnNames of the DataSourceCsv. |
| setQualifier(String) | Sets the qualifier character that encloses DataField values. |
| setSeparator(String) | Sets the separator character that separates DataField-names or DataField-values. |