public interface Parser
Modifier and Type | Method and Description |
---|---|
String |
getDataFileTable()
Returns the table name that will be used to read the MetaData from the db.
|
String |
getDataStructureTable()
Returns the table name that will be used to read the MetaData from the db.
|
boolean |
isColumnNamesCaseSensitive()
Default is false
|
boolean |
isFlagEmptyRows() |
boolean |
isHandlingShortLines() |
boolean |
isIgnoreExtraColumns() |
boolean |
isIgnoreParseWarnings()
Default is false
|
boolean |
isNullEmptyStrings() |
boolean |
isPreserveLeadingWhitespace()
Defaults to
true . |
boolean |
isPreserveTrailingWhitespace()
Defaults to
false . |
boolean |
isStoreRawDataToDataError() |
boolean |
isStoreRawDataToDataSet() |
DataSet |
parse()
Start the parsing.
|
StreamingDataSet |
parseAsStream()
Parse the data and return an interface where one can extract one record at a time, until
next returns false;
|
Parser |
setAddSuffixToDuplicateColumnNames(boolean addSuffixToDuplicateColumnNames) |
Parser |
setColumnNamesCaseSensitive(boolean columnNamesCaseSensitive)
Default is false
|
Parser |
setDataFileTable(String dataFileTable)
Sets the table name that will be used to read the MetaData from the db.
|
Parser |
setDataStructureTable(String dataStructureTable)
Sets the table name that will be used to read the MetaData from the db.
|
Parser |
setFlagEmptyRows(boolean flagEmptyRows)
when true, will analyze the row to see if all elements are empty and
place a flag on the DataSet indicating if the row is empty.
|
Parser |
setHandlingShortLines(boolean handleShortLines) |
Parser |
setIgnoreExtraColumns(boolean ignoreExtraColumns) |
Parser |
setIgnoreParseWarnings(boolean ignoreParseWarnings) |
Parser |
setNullEmptyStrings(boolean nullEmptyStrings) |
Parser |
setPreserveLeadingWhitespace(boolean preserveLeadingWhitespace)
Defaults to
true . |
Parser |
setPreserveTrailingWhitespace(boolean preserveTrailingWhitespace)
Defaults to
false . |
Parser |
setStoreRawDataToDataError(boolean storeRawDataToDataError)
when true, the parser will place the data of the line which failed the parse and
place it into the DataError object.
|
Parser |
setStoreRawDataToDataSet(boolean storeRawDataToDataError)
WARNING!! Setting this option has potential to cause high memory usage.
|
Stream<Record> |
stream()
Parse the data and return a stream or records;
|
DataSet parse()
StreamingDataSet parseAsStream()
Stream<Record> stream()
boolean isHandlingShortLines()
Parser setHandlingShortLines(boolean handleShortLines)
handleShortLines
- -
when flagged as true, lines with less columns then the amount
of column headers will be added as empty's instead of
producing an errorParser setAddSuffixToDuplicateColumnNames(boolean addSuffixToDuplicateColumnNames)
addSuffixToDuplicateColumnNames
- when true, add a count to duplicate colum names. eg the second column called "Asset" will become "Asset2".boolean isIgnoreExtraColumns()
Parser setIgnoreExtraColumns(boolean ignoreExtraColumns)
ignoreExtraColumns
- when true, detail lines with a length or column count > the
mapping definition will be truncated and the reader will NOT
register these lines as errors in the DataError collection.boolean isPreserveLeadingWhitespace()
true
.Parser setPreserveLeadingWhitespace(boolean preserveLeadingWhitespace)
true
.preserveLeadingWhitespace
- when true, the parser will preserve leading whitespace in each column when splitting a lineboolean isPreserveTrailingWhitespace()
false
.Parser setPreserveTrailingWhitespace(boolean preserveTrailingWhitespace)
false
.preserveTrailingWhitespace
- when true, the parser will preserve trailing whitespace in each column when splitting a lineboolean isColumnNamesCaseSensitive()
Parser setColumnNamesCaseSensitive(boolean columnNamesCaseSensitive)
columnNamesCaseSensitive
- when true, column names will have to be an exact match when
retrieving the value of a column. Example when true: Column
name = AColumnName ; getString("acolumnname") would fail
Example when false: Column name = AColumnName ;
getString("acolumnname") would passboolean isIgnoreParseWarnings()
Parser setIgnoreParseWarnings(boolean ignoreParseWarnings)
ignoreParseWarnings
- when true, warnings encountered during parsing will not be
included in the DataSet errorsboolean isNullEmptyStrings()
Parser setNullEmptyStrings(boolean nullEmptyStrings)
nullEmptyStrings
- when true, empty Strings will get returned as NULL when
calling DataSet.getString()boolean isFlagEmptyRows()
Parser setFlagEmptyRows(boolean flagEmptyRows)
flagEmptyRows
- true if we need to flag empty rowsboolean isStoreRawDataToDataError()
Parser setStoreRawDataToDataError(boolean storeRawDataToDataError)
storeRawDataToDataError
- true if we need to store each linesboolean isStoreRawDataToDataSet()
Parser setStoreRawDataToDataSet(boolean storeRawDataToDataError)
storeRawDataToDataError
- true if we need to store the raw dataString getDataFileTable()
Parser setDataFileTable(String dataFileTable)
dataFileTable
- Name of the table name to use in place of "DATAFILE"String getDataStructureTable()
Parser setDataStructureTable(String dataStructureTable)
dataStructureTable
- Name of the table name to us in placfe of "DATASTRUCTURE"Copyright © 2006–2021 Appendium - Portfolio Financing Platform. All rights reserved.