Package org.dashbuilder.dataprovider.csv
Class CSVParser
- java.lang.Object
-
- org.dashbuilder.dataprovider.csv.CSVParser
-
public class CSVParser extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,DateFormat>_dateFormatMapprotected Map<String,DecimalFormat>_numberFormatMapprotected CSVFileStoragecsvStorageprotected org.dashbuilder.dataset.def.CSVDataSetDefdataSetDefstatic StringDATE_FORMAT_EPOCH
-
Constructor Summary
Constructors Constructor Description CSVParser(org.dashbuilder.dataset.def.CSVDataSetDef def, CSVFileStorage csvFileStorage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_processLine(org.dashbuilder.dataset.DataSet dataSet, Object[] row, String[] line, List<Integer> columnIdxs)protected org.dashbuilder.dataset.ColumnTypecalculateType(String columnId, String value)protected booleancanBeParsedAsNumber(DecimalFormat parser, String value)protected InputStreamgetCSVInputStream()protected DateFormatgetDateFormat(String columnId)protected DecimalFormatgetNumberFormat(String columnId)protected booleanisColumnIncluded(String columnId)protected org.dashbuilder.dataset.DataSetload()protected ObjectparseValue(org.dashbuilder.dataset.DataColumn column, String value)
-
-
-
Field Detail
-
DATE_FORMAT_EPOCH
public static final String DATE_FORMAT_EPOCH
- See Also:
- Constant Field Values
-
_dateFormatMap
protected transient Map<String,DateFormat> _dateFormatMap
-
_numberFormatMap
protected transient Map<String,DecimalFormat> _numberFormatMap
-
dataSetDef
protected org.dashbuilder.dataset.def.CSVDataSetDef dataSetDef
-
csvStorage
protected CSVFileStorage csvStorage
-
-
Constructor Detail
-
CSVParser
public CSVParser(org.dashbuilder.dataset.def.CSVDataSetDef def, CSVFileStorage csvFileStorage)
-
-
Method Detail
-
isColumnIncluded
protected boolean isColumnIncluded(String columnId)
-
getCSVInputStream
protected InputStream getCSVInputStream() throws Exception
- Throws:
Exception
-
calculateType
protected org.dashbuilder.dataset.ColumnType calculateType(String columnId, String value)
-
canBeParsedAsNumber
protected boolean canBeParsedAsNumber(DecimalFormat parser, String value)
-
_processLine
protected void _processLine(org.dashbuilder.dataset.DataSet dataSet, Object[] row, String[] line, List<Integer> columnIdxs) throws Exception- Throws:
Exception
-
parseValue
protected Object parseValue(org.dashbuilder.dataset.DataColumn column, String value) throws Exception
- Throws:
Exception
-
getDateFormat
protected DateFormat getDateFormat(String columnId)
-
getNumberFormat
protected DecimalFormat getNumberFormat(String columnId)
-
-