|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.flatpack.AbstractParser
public abstract class AbstractParser
Constructor Summary | |
---|---|
protected |
AbstractParser(java.io.Reader dataSourceReader)
|
protected |
AbstractParser(java.io.Reader dataSourceReader,
java.lang.String dataDefinition)
|
Method Summary | |
---|---|
protected void |
addError(DefaultDataSet ds,
java.lang.String errorDesc,
int lineNo,
int errorLevel)
Adds a new error to this DataSet. |
protected void |
addError(DefaultDataSet ds,
java.lang.String errorDesc,
int lineNo,
int errorLevel,
java.lang.String lineData)
Adds a new error to this DataSet. |
protected void |
addToCloseReaderList(java.io.Reader r)
|
protected void |
addToMetaData(java.util.List columns)
|
protected void |
closeReaders()
|
protected abstract DataSet |
doParse()
|
protected java.lang.String |
getDataDefinition()
|
java.lang.String |
getDataFileTable()
Returns the table name that will be used to read the MetaData from the db. |
protected java.io.Reader |
getDataSourceReader()
|
java.lang.String |
getDataStructureTable()
Returns the table name that will be used to read the MetaData from the db. |
MetaData |
getPzMetaData()
|
protected abstract void |
init()
|
boolean |
isColumnNamesCaseSensitive()
Default is false |
boolean |
isFlagEmptyRows()
|
boolean |
isHandlingShortLines()
|
boolean |
isIgnoreExtraColumns()
|
boolean |
isIgnoreParseWarnings()
Default is false |
protected boolean |
isInitialised()
|
boolean |
isNullEmptyStrings()
|
boolean |
isStoreRawDataToDataError()
|
boolean |
isStoreRawDataToDataSet()
|
DataSet |
parse()
Start the parsing. |
void |
setColumnNamesCaseSensitive(boolean columnNamesCaseSensitive)
Default is false |
protected void |
setDataDefinition(java.lang.String dataDefinition)
|
void |
setDataFileTable(java.lang.String dataFileTable)
Sets the table name that will be used to read the MetaData from the db. |
protected void |
setDataSourceReader(java.io.Reader dataSourceReader)
|
void |
setDataStructureTable(java.lang.String dataStructureTable)
Sets the table name that will be used to read the MetaData from the db. |
void |
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. |
void |
setHandlingShortLines(boolean handleShortLines)
|
void |
setIgnoreExtraColumns(boolean ignoreExtraColumns)
|
void |
setIgnoreParseWarnings(boolean ignoreParseWarnings)
|
protected void |
setInitialised(boolean initialised)
|
void |
setNullEmptyStrings(boolean nullEmptyStrings)
|
void |
setPzMetaData(MetaData pzMap)
|
void |
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. |
void |
setStoreRawDataToDataSet(boolean storeRawDataToDataSet)
WARNING!! |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractParser(java.io.Reader dataSourceReader)
protected AbstractParser(java.io.Reader dataSourceReader, java.lang.String dataDefinition)
Method Detail |
---|
public boolean isHandlingShortLines()
isHandlingShortLines
in interface Parser
public void setHandlingShortLines(boolean handleShortLines)
setHandlingShortLines
in interface Parser
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 errorpublic boolean isIgnoreExtraColumns()
isIgnoreExtraColumns
in interface Parser
public void setIgnoreExtraColumns(boolean ignoreExtraColumns)
setIgnoreExtraColumns
in interface Parser
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.public final DataSet parse()
Parser
parse
in interface Parser
protected abstract DataSet doParse()
protected abstract void init()
protected void closeReaders() throws java.io.IOException
java.io.IOException
protected void addToCloseReaderList(java.io.Reader r)
protected void addToMetaData(java.util.List columns)
protected boolean isInitialised()
protected void setInitialised(boolean initialised)
protected java.lang.String getDataDefinition()
protected void setDataDefinition(java.lang.String dataDefinition)
protected void addError(DefaultDataSet ds, java.lang.String errorDesc, int lineNo, int errorLevel)
errorDesc
- String description of errorlineNo
- line number error occurred onerrorLevel
- errorLevel 1,2,3 1=warning 2=error 3= severe errorprotected void addError(DefaultDataSet ds, java.lang.String errorDesc, int lineNo, int errorLevel, java.lang.String lineData)
errorDesc
- String description of errorlineNo
- line number error occurred onerrorLevel
- errorLevel 1,2,3 1=warning 2=error 3= severe error'lineData
- Data of the line which failed the parseprotected java.io.Reader getDataSourceReader()
protected void setDataSourceReader(java.io.Reader dataSourceReader)
dataSourceReader
- the dataSourceReader to setpublic boolean isColumnNamesCaseSensitive()
Parser
isColumnNamesCaseSensitive
in interface Parser
public void setColumnNamesCaseSensitive(boolean columnNamesCaseSensitive)
Parser
setColumnNamesCaseSensitive
in interface Parser
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 passpublic boolean isIgnoreParseWarnings()
Parser
isIgnoreParseWarnings
in interface Parser
public void setIgnoreParseWarnings(boolean ignoreParseWarnings)
setIgnoreParseWarnings
in interface Parser
ignoreParseWarnings
- when true, warnings encountered during parsing will not be
included in the DataSet errorspublic boolean isNullEmptyStrings()
isNullEmptyStrings
in interface Parser
public void setNullEmptyStrings(boolean nullEmptyStrings)
setNullEmptyStrings
in interface Parser
nullEmptyStrings
- when true, empty Strings will get returned as NULL when
calling DataSet.getString()public MetaData getPzMetaData()
public void setPzMetaData(MetaData pzMap)
public boolean isFlagEmptyRows()
isFlagEmptyRows
in interface Parser
public void setFlagEmptyRows(boolean flagEmptyRows)
Parser
setFlagEmptyRows
in interface Parser
flagEmptyRows
- the flagEmptyRows to setpublic boolean isStoreRawDataToDataError()
isStoreRawDataToDataError
in interface Parser
public void setStoreRawDataToDataError(boolean storeRawDataToDataError)
Parser
setStoreRawDataToDataError
in interface Parser
storeRawDataToDataError
- the storeRawDataToDataError to setpublic boolean isStoreRawDataToDataSet()
isStoreRawDataToDataSet
in interface Parser
public void setStoreRawDataToDataSet(boolean storeRawDataToDataSet)
Parser
setStoreRawDataToDataSet
in interface Parser
storeRawDataToDataSet
- the storeRawDataToDataSet to setpublic java.lang.String getDataFileTable()
Parser
getDataFileTable
in interface Parser
public void setDataFileTable(java.lang.String dataFileTable)
Parser
setDataFileTable
in interface Parser
dataFileTable
- Name of the table name to use in place of "DATAFILE"public java.lang.String getDataStructureTable()
Parser
getDataStructureTable
in interface Parser
public void setDataStructureTable(java.lang.String dataStructureTable)
Parser
setDataStructureTable
in interface Parser
dataStructureTable
- Name of the table name to us in placfe of "DATASTRUCTURE"
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |