public class DumpingNdfHandler extends NdfHandler
allowedInNames, blockCommentChar, booleanFalseChar, booleanFalseLiteral, booleanTrueChar, booleanTrueLiteral, currentNdfDocVersion, defaultTextEndChar, defaultTextParagraphChar, lineCommentChar, ndfDocAuthorKey, ndfDocCreatedKey, ndfDocEncodingKey, ndfDocTypeKey, ndfDocVersionKey, nullLiteral, quotingBreakCodes, standardBreakCodes, structureChar, textValueBreakCodes, validTextBreakSymbols| Constructor and Description |
|---|
DumpingNdfHandler() |
DumpingNdfHandler(java.io.File outputFile) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptDocumentVersion(java.lang.String documentVersion)
Overridden to log a warning if the currentNdfDocVersion does not match the NdfParser version.
|
void |
doneArray(NdfStructure struct)
Called when an array structure is done.
|
void |
doneDocument(NdfStructure struct)
Called when document parsing has finished.
|
void |
doneList(NdfStructure struct)
Called when a list structure is done.
|
void |
doneObject(NdfStructure struct)
Called when an object structure is done.
|
void |
doneTable(NdfStructure struct)
Called when a table structure is done.
|
void |
foundArrayValue(NdfStructure struct,
int dimension,
int index,
AsciiWord word)
Called when an array value was found within an array structure.
|
void |
foundArrayValue(NdfStructure struct,
int dimension,
int index,
java.lang.String value)
Called when an array value was found within an array structure.
|
void |
foundListValue(NdfStructure struct,
AsciiWord data)
Called when a list value was found within a list structure.
|
void |
foundListValue(NdfStructure struct,
java.lang.String value)
Called when a list value was found within a list structure.
|
void |
foundProperties(NdfStructure struct,
NdfProperties props)
Called when properties are found on top level.
|
void |
foundTableCell(NdfStructure struct,
int rowIndex,
int columnIndex,
AsciiWord data)
Called when a table cell value was found within a table structure.
|
void |
foundTableRow(NdfStructure struct,
int rowIndex,
NdfProperties rowProps)
Called when a table row was found within a table structure.
|
void |
foundTableRow(NdfStructure struct,
int rowIndex,
java.lang.String[] rowData)
Called when a table row was found within a table structure.
|
void |
foundText(NdfStructure struct,
int paragraphIndex,
java.util.List<java.lang.String> lines)
Notifies about text-lines found within a TEXT structure.
|
void |
foundText(NdfStructure struct,
java.lang.String text)
Notifies about the text found within a TEXT structure.
|
NotifyArrayValue |
startArray(NdfStructure struct,
NdfProperties props,
int[] dimensions)
Called when an array structure was found.
|
void |
startDocument(NdfStructure struct,
NdfProperties props)
Called when document parsing is started.
|
NotifyListValue |
startList(NdfStructure struct,
NdfProperties props)
Called when a list structure was found.
|
void |
startObject(NdfStructure struct,
NdfProperties props)
Called when an object structure was detected.
|
NotifyTableValue |
startTable(NdfStructure struct,
NdfProperties props,
java.lang.String[] columns)
Called when a table structure was found.
|
checkDocumentType, doneText, getCurrentNestingLevel, getCurrentStructure, getDocAuthor, getDocCreated, getDocEncoding, getDocType, getDocVersion, getFileInfo, getLineNumber, getLogChannel, getMaxNestingLevel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel, startTextpublic DumpingNdfHandler()
public DumpingNdfHandler(java.io.File outputFile)
throws java.lang.Exception
java.lang.Exceptionpublic boolean acceptDocumentVersion(java.lang.String documentVersion)
acceptDocumentVersion in class NdfHandlerpublic void startDocument(NdfStructure struct, NdfProperties props) throws java.lang.Exception
NdfHandlerstartDocument in class NdfHandlerprops - the header properties found in the documentjava.lang.Exceptionpublic void doneDocument(NdfStructure struct) throws java.lang.Exception
NdfHandlerdoneDocument in class NdfHandlerjava.lang.Exceptionpublic void foundProperties(NdfStructure struct, NdfProperties props) throws java.lang.Exception
NdfHandlerfoundProperties in class NdfHandlerjava.lang.Exceptionpublic void startObject(NdfStructure struct, NdfProperties props) throws java.lang.Exception
NdfHandlerstartObject in class NdfHandlerjava.lang.Exceptionpublic void foundText(NdfStructure struct, int paragraphIndex, java.util.List<java.lang.String> lines) throws java.lang.Exception
NdfHandlerfoundText in class NdfHandlerjava.lang.Exceptionpublic void foundText(NdfStructure struct, java.lang.String text) throws java.lang.Exception
NdfHandlerfoundText in class NdfHandlerjava.lang.Exceptionpublic void doneObject(NdfStructure struct) throws java.lang.Exception
NdfHandlerdoneObject in class NdfHandlerjava.lang.Exceptionpublic NotifyTableValue startTable(NdfStructure struct, NdfProperties props, java.lang.String[] columns) throws java.lang.Exception
NdfHandlerNotifyTableValue.AS_PROPERTIESNdfHandler.foundTableRow(NdfStructure, int, NdfProperties)NotifyTableValue.AS_STRING_ARRAYNdfHandler.foundTableRow(NdfStructure, int, String[])
NotifyTableValue.AS_BUFFERED_WORDNdfHandler.foundTableCell(NdfStructure, int, int, AsciiWord)startTable in class NdfHandlerjava.lang.Exceptionpublic void foundTableRow(NdfStructure struct, int rowIndex, java.lang.String[] rowData) throws java.lang.Exception
NdfHandlerNotifyTableValue.AS_STRING_ARRAY notification mode.
It is quite expensive because it parses values the same way as property values.foundTableRow in class NdfHandlerjava.lang.Exceptionpublic void foundTableRow(NdfStructure struct, int rowIndex, NdfProperties rowProps) throws java.lang.Exception
NdfHandlerNotifyTableValue.AS_PROPERTIES notification mode.
It is quite expensive because it parses values the same way as property values.
But it provides the convenience to extract values readily converted to the desired data type.foundTableRow in class NdfHandlerjava.lang.Exceptionpublic void foundTableCell(NdfStructure struct, int rowIndex, int columnIndex, AsciiWord data) throws java.lang.Exception
NdfHandlerNotifyTableValue.AS_BUFFERED_WORD notification mode.
It is very fast but does no interpretation on the read words at all.
It does also NOT support quoting of values and thus can only be used for numeric values.
For fast data conversion use data.asDouble(), data.asInt() etc.
Note that this method is called for each cell value in a table row.foundTableCell in class NdfHandlerjava.lang.Exceptionpublic void doneTable(NdfStructure struct) throws java.lang.Exception
NdfHandlerdoneTable in class NdfHandlerjava.lang.Exceptionpublic NotifyArrayValue startArray(NdfStructure struct, NdfProperties props, int[] dimensions) throws java.lang.Exception
NdfHandlerNotifyArrayValue.AS_STRINGNdfHandler.foundArrayValue(NdfStructure, int, int, String)
NotifyArrayValue.AS_BUFFERED_WORDNdfHandler.foundArrayValue(NdfStructure, int, int, AsciiWord)startArray in class NdfHandlerjava.lang.Exceptionpublic void foundArrayValue(NdfStructure struct, int dimension, int index, java.lang.String value) throws java.lang.Exception
NdfHandlerNotifyArrayValue.AS_STRING notification mode.
It is quite expensive because it parses values the same way as property values.foundArrayValue in class NdfHandlerjava.lang.Exceptionpublic void foundArrayValue(NdfStructure struct, int dimension, int index, AsciiWord word) throws java.lang.Exception
NdfHandlerNotifyArrayValue.AS_BUFFERED_WORD notification mode.
It is very fast but does no interpretation on the read words at all.
For fast data conversion use data.asDouble(), data.asInt() etc.foundArrayValue in class NdfHandlerjava.lang.Exceptionpublic void doneArray(NdfStructure struct) throws java.lang.Exception
NdfHandlerdoneArray in class NdfHandlerjava.lang.Exceptionpublic NotifyListValue startList(NdfStructure struct, NdfProperties props) throws java.lang.Exception
NdfHandlerNotifyListValue.AS_STRINGNdfHandler.foundListValue(NdfStructure, String)
NotifyListValue.AS_BUFFERED_WORDNdfHandler.foundListValue(NdfStructure, AsciiWord)startList in class NdfHandlerjava.lang.Exceptionpublic void foundListValue(NdfStructure struct, java.lang.String value) throws java.lang.Exception
NdfHandlerNotifyListValue.AS_STRING notification mode.
It is quite expensive because it parses values the same way as property values.foundListValue in class NdfHandlerjava.lang.Exceptionpublic void foundListValue(NdfStructure struct, AsciiWord data) throws java.lang.Exception
NdfHandlerNotifyListValue.AS_BUFFERED_WORD notification mode.
It is very fast but does no interpretation on the read words at all.
For fast data conversion use data.asDouble(), data.asInt() etc.foundListValue in class NdfHandlerjava.lang.Exceptionpublic void doneList(NdfStructure struct) throws java.lang.Exception
NdfHandlerdoneList in class NdfHandlerjava.lang.ExceptionCopyright © 2014 EsprIT-Systems. All Rights Reserved.