Package org.dashbuilder.dataset.def
Interface CSVDataSetDefBuilder<T extends DataSetDefBuilder>
-
- All Superinterfaces:
DataSetDefBuilder<T>
- All Known Implementing Classes:
CSVDataSetDefBuilderImpl
public interface CSVDataSetDefBuilder<T extends DataSetDefBuilder> extends DataSetDefBuilder<T>
A builder for defining static data setsDataSetDef dataSetDef = DataSetDefFactory.newCSVDataSetDef() .uuid("all_employees") .url("http://myhost.com/file.csv") .separatorChar(";") .label("name") .date("creationDate", "MM/dd/yyyy") .number("amount", "#.###,00") .buildDef();
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TallColumns(boolean all)It tells the CSV provider whether to include all the columns in the CSV defintion or only those columns explicitly declared into the data set definition.Tdate(String columnId, String pattern)Set the pattern for the specified date column.TdatePattern(String pattern)Set the overall pattern used to read date columns.TescapeChar(char escape)Set the escape char.TfilePath(String path)The CSV file pathTfileURL(String url)A valid CSV stream URLTnumber(String columnId, String pattern)Set the pattern for the specified numeric column.TnumberPattern(String pattern)Set the overall pattern used to read numeric columns.TquoteChar(char quote)Set the quote symbol.TseparatorChar(char separator)Set the CSV column separator char.
-
-
-
Method Detail
-
fileURL
T fileURL(String url)
A valid CSV stream URL- Parameters:
url- A valid URL to a CSV stream- Returns:
- The DataSetDefBuilder instance that is being used to configure a DataSetDef.
-
filePath
T filePath(String path)
The CSV file path- Parameters:
path- A valid path to a local file.- Returns:
- The DataSetDefBuilder instance that is being used to configure a DataSetDef.
-
allColumns
T allColumns(boolean all)
It tells the CSV provider whether to include all the columns in the CSV defintion or only those columns explicitly declared into the data set definition.- Parameters:
all- If tru all the CSV columns will be part of the data set (default true).- Returns:
- The DataSetDefBuilder instance that is being used to configure a DataSetDef.
-
separatorChar
T separatorChar(char separator)
Set the CSV column separator char.- Parameters:
separator- An string for separating columns- Returns:
- The DataSetDefBuilder instance that is being used to configure a DataSetDef.
-
quoteChar
T quoteChar(char quote)
Set the quote symbol.- Parameters:
quote- A char representing the quote symbol- Returns:
- The DataSetDefBuilder instance that is being used to configure a DataSetDef.
-
escapeChar
T escapeChar(char escape)
Set the escape char.- Parameters:
escape- The scape char- Returns:
- The DataSetDefBuilder instance that is being used to configure a DataSetDef.
-
date
T date(String columnId, String pattern)
Set the pattern for the specified date column.- Parameters:
columnId- The id of the columnpattern- The pattern of the column values. (See java.text.DateFormat)- Returns:
- The DataSetDefBuilder instance that is being used to configure a DataSetDef.
- See Also:
SimpleDateFormat
-
number
T number(String columnId, String pattern)
Set the pattern for the specified numeric column.- Parameters:
columnId- The id of the columnpattern- The pattern of the column values. (See java.text.DecimalFormat)- Returns:
- The DataSetDefBuilder instance that is being used to configure a DataSetDef.
- See Also:
DecimalFormat
-
datePattern
T datePattern(String pattern)
Set the overall pattern used to read date columns.- Parameters:
pattern- The pattern of the column values. (See java.text.DateFormat)- Returns:
- The DataSetDefBuilder instance that is being used to configure a DataSetDef.
- See Also:
SimpleDateFormat
-
numberPattern
T numberPattern(String pattern)
Set the overall pattern used to read numeric columns.- Parameters:
pattern- The pattern of the column values. (See java.text.DecimalFormat)- Returns:
- The DataSetDefBuilder instance that is being used to configure a DataSetDef.
- See Also:
DecimalFormat
-
-