public class LoggingNdfHandler 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 |
---|
LoggingNdfHandler() |
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 |
doneText(NdfStructure struct)
Called when a TEXT 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.
|
NotifyText |
startText(NdfStructure struct,
NdfProperties props)
Called when a TEXT structure was found.
|
checkDocumentType, getCurrentNestingLevel, getCurrentStructure, getDocAuthor, getDocCreated, getDocEncoding, getDocType, getDocVersion, getFileInfo, getLineNumber, getLogChannel, getMaxNestingLevel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
public boolean acceptDocumentVersion(java.lang.String documentVersion)
acceptDocumentVersion
in class NdfHandler
public void startDocument(NdfStructure struct, NdfProperties props) throws java.lang.Exception
NdfHandler
startDocument
in class NdfHandler
props
- the header properties found in the documentjava.lang.Exception
public void doneDocument(NdfStructure struct) throws java.lang.Exception
NdfHandler
doneDocument
in class NdfHandler
java.lang.Exception
public void foundProperties(NdfStructure struct, NdfProperties props) throws java.lang.Exception
NdfHandler
foundProperties
in class NdfHandler
java.lang.Exception
public void startObject(NdfStructure struct, NdfProperties props) throws java.lang.Exception
NdfHandler
startObject
in class NdfHandler
java.lang.Exception
public NotifyText startText(NdfStructure struct, NdfProperties props) throws java.lang.Exception
NdfHandler
startText
in class NdfHandler
java.lang.Exception
public void foundText(NdfStructure struct, int paragraphIndex, java.util.List<java.lang.String> lines) throws java.lang.Exception
NdfHandler
foundText
in class NdfHandler
java.lang.Exception
public void foundText(NdfStructure struct, java.lang.String text) throws java.lang.Exception
NdfHandler
foundText
in class NdfHandler
java.lang.Exception
public void doneText(NdfStructure struct) throws java.lang.Exception
NdfHandler
doneText
in class NdfHandler
java.lang.Exception
public void doneObject(NdfStructure struct) throws java.lang.Exception
NdfHandler
doneObject
in class NdfHandler
java.lang.Exception
public NotifyTableValue startTable(NdfStructure struct, NdfProperties props, java.lang.String[] columns) throws java.lang.Exception
NdfHandler
NotifyTableValue.AS_PROPERTIES
NdfHandler.foundTableRow(NdfStructure, int, NdfProperties)
NotifyTableValue.AS_STRING_ARRAY
NdfHandler.foundTableRow(NdfStructure, int, String[])
NotifyTableValue.AS_BUFFERED_WORD
NdfHandler.foundTableCell(NdfStructure, int, int, AsciiWord)
startTable
in class NdfHandler
java.lang.Exception
public void foundTableRow(NdfStructure struct, int rowIndex, java.lang.String[] rowData) throws java.lang.Exception
NdfHandler
NotifyTableValue.AS_STRING_ARRAY
notification mode.
It is quite expensive because it parses values the same way as property values.foundTableRow
in class NdfHandler
java.lang.Exception
public void foundTableRow(NdfStructure struct, int rowIndex, NdfProperties rowProps) throws java.lang.Exception
NdfHandler
NotifyTableValue.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 NdfHandler
java.lang.Exception
public void foundTableCell(NdfStructure struct, int rowIndex, int columnIndex, AsciiWord data) throws java.lang.Exception
NdfHandler
NotifyTableValue.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 NdfHandler
java.lang.Exception
public void doneTable(NdfStructure struct) throws java.lang.Exception
NdfHandler
doneTable
in class NdfHandler
java.lang.Exception
public NotifyArrayValue startArray(NdfStructure struct, NdfProperties props, int[] dimensions) throws java.lang.Exception
NdfHandler
NotifyArrayValue.AS_STRING
NdfHandler.foundArrayValue(NdfStructure, int, int, String)
NotifyArrayValue.AS_BUFFERED_WORD
NdfHandler.foundArrayValue(NdfStructure, int, int, AsciiWord)
startArray
in class NdfHandler
java.lang.Exception
public void foundArrayValue(NdfStructure struct, int dimension, int index, java.lang.String value) throws java.lang.Exception
NdfHandler
NotifyArrayValue.AS_STRING
notification mode.
It is quite expensive because it parses values the same way as property values.foundArrayValue
in class NdfHandler
java.lang.Exception
public void foundArrayValue(NdfStructure struct, int dimension, int index, AsciiWord word) throws java.lang.Exception
NdfHandler
NotifyArrayValue.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 NdfHandler
java.lang.Exception
public void doneArray(NdfStructure struct) throws java.lang.Exception
NdfHandler
doneArray
in class NdfHandler
java.lang.Exception
public NotifyListValue startList(NdfStructure struct, NdfProperties props) throws java.lang.Exception
NdfHandler
NotifyListValue.AS_STRING
NdfHandler.foundListValue(NdfStructure, String)
NotifyListValue.AS_BUFFERED_WORD
NdfHandler.foundListValue(NdfStructure, AsciiWord)
startList
in class NdfHandler
java.lang.Exception
public void foundListValue(NdfStructure struct, java.lang.String value) throws java.lang.Exception
NdfHandler
NotifyListValue.AS_STRING
notification mode.
It is quite expensive because it parses values the same way as property values.foundListValue
in class NdfHandler
java.lang.Exception
public void foundListValue(NdfStructure struct, AsciiWord data) throws java.lang.Exception
NdfHandler
NotifyListValue.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 NdfHandler
java.lang.Exception
public void doneList(NdfStructure struct) throws java.lang.Exception
NdfHandler
doneList
in class NdfHandler
java.lang.Exception
Copyright © 2014 EsprIT-Systems. All Rights Reserved.