public class NdfDefaultHandler extends NdfHandler
allowedInNames, blockCommentChar, booleanFalseChar, booleanFalseLiteral, booleanTrueChar, booleanTrueLiteral, lineCommentChar, ndfAuthorKey, ndfBreakChars, ndfDocCreatedKey, ndfDocTypeKey, ndfDocVersion, ndfDocVersionKey, nullLiteral, quotingBreakChars, separatorLineChar, structureChar, textBreakChars, textParagraph| Constructor and Description |
|---|
NdfDefaultHandler() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptDocumentVersion(java.lang.String documentVersion)
Overridden to log a warning if the ndfDocVersion does not match the NdfParser version.
|
void |
doneArray(NdfStructure struct)
Called when an array structure is done.
|
void |
doneDocument()
Called when document parsing has finished.
|
void |
doneObject(NdfStructure struct)
Called when an object structure is done.
|
void |
doneProperty(java.lang.String key,
java.util.List<java.lang.String> valueList)
Called when a property with multiple values was found
within an object structure.
|
void |
doneProperty(java.lang.String key,
java.lang.String value)
Called when a property was found within an object structure.
|
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 |
foundBodyText(NdfStructure struct,
java.util.List<java.lang.String> lines)
Called when a body-text was found within an object structure.
|
void |
foundHeaderProperties(NdfProperties props)
Called when properties are found as top level elements.
|
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.
|
NotifyArrayValue |
startArray(NdfStructure struct,
NdfProperties props,
int[] dimensions)
Called when an array structure was found.
|
void |
startDocument(FileInfo fileInfo,
NdfProperties props)
Called when document parsing is about to start.
|
NotifyBodyText |
startObject(NdfStructure struct,
NdfProperties props)
Called when an object structure was detected.
|
void |
startProperty(java.lang.String key)
Called when a property key was found.
|
NotifyTableValue |
startTable(NdfStructure struct,
NdfProperties props,
java.lang.String[] columns)
Called when a table structure was found.
|
asStuffedText, checkDocumentType, getCurrentNestingLevel, getCurrentStructure, getFileInfo, getLineNumber, getLogChannel, getMaxNestingLevel, getStructure, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannelpublic boolean acceptDocumentVersion(java.lang.String documentVersion)
acceptDocumentVersion in class NdfHandlerpublic void startDocument(FileInfo fileInfo, NdfProperties props) throws java.lang.Exception
NdfHandlerstartDocument in class NdfHandlerprops - the header properties found in the documentjava.lang.Exceptionpublic void doneDocument()
throws java.lang.Exception
NdfHandlerdoneDocument in class NdfHandlerjava.lang.Exceptionpublic void startProperty(java.lang.String key)
throws java.lang.Exception
NdfHandlerstartProperty in class NdfHandlerjava.lang.ExceptionNdfHandler.doneProperty(String, String)public void doneProperty(java.lang.String key,
java.lang.String value)
throws java.lang.Exception
NdfHandlerdoneProperty in class NdfHandlerjava.lang.ExceptionNdfHandler.startProperty(String)public void doneProperty(java.lang.String key,
java.util.List<java.lang.String> valueList)
throws java.lang.Exception
NdfHandlerdoneProperty in class NdfHandlerjava.lang.Exceptionpublic void foundHeaderProperties(NdfProperties props) throws java.lang.Exception
NdfHandlerfoundHeaderProperties in class NdfHandlerjava.lang.Exceptionpublic NotifyBodyText startObject(NdfStructure struct, NdfProperties props) throws java.lang.Exception
NdfHandlerNdfHandler.foundBodyText(NdfStructure, List) if this method
returns NotifyBodyText.NOTIFY. If NotifyBodyText.SKIP
is returned then no body text evaluation is done at all.startObject in class NdfHandlerjava.lang.Exceptionpublic void foundBodyText(NdfStructure struct, java.util.List<java.lang.String> lines) throws java.lang.Exception
NdfHandlerNdfHandler.startObject(NdfStructure, NdfProperties) returned
NotifyBodyText.SKIP.foundBodyText 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
NdfHandlerNdfHandler.foundTableRow(NdfStructure, int, NdfProperties) will be called.startTable in class NdfHandlerjava.lang.Exceptionpublic void foundTableRow(NdfStructure struct, int rowIndex, java.lang.String[] rowData) throws java.lang.Exception
NdfHandlerNotifyTableValue.AS_STRING_ARRAY mode.
It is quite expensive because it parses values the same way as property values.foundTableRow in class NdfHandlerjava.lang.ExceptionNdfHandler.foundTableCell(NdfStructure, int, int, AsciiWord)public void foundTableRow(NdfStructure struct, int rowIndex, NdfProperties rowProps) throws java.lang.Exception
NdfHandlerNotifyTableValue.AS_PROPERTIES mode.
It is quite expensive because it parses values the same way as property values.
But it provides the convenience to extract values in the desired type.foundTableRow in class NdfHandlerjava.lang.ExceptionNdfHandler.foundTableCell(NdfStructure, int, int, AsciiWord)public void foundTableCell(NdfStructure struct, int rowIndex, int columnIndex, AsciiWord data) throws java.lang.Exception
NdfHandlerNotifyTableValue.AS_ASCII_WORD mode.
It is very fast but does no interpretation on the read words at all.
You may use methods like word.asDouble() etc. for numeric conversion.
Note that this method is called for each row value in a table row.foundTableCell in class NdfHandlerjava.lang.ExceptionNdfHandler.foundTableRow(NdfStructure, int, String[])public 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
NdfHandlerstartArray in class NdfHandlerjava.lang.Exceptionpublic void foundArrayValue(NdfStructure struct, int dimension, int index, java.lang.String value) throws java.lang.Exception
NdfHandlerNotifyArrayValue.AS_STRING mode.
It is quite expensive because it parses values the same way as property values.foundArrayValue in class NdfHandlerjava.lang.ExceptionNdfHandler.foundArrayValue(NdfStructure, int, int, AsciiWord)public void foundArrayValue(NdfStructure struct, int dimension, int index, AsciiWord word) throws java.lang.Exception
NdfHandlerNotifyArrayValue.AS_ASCII_WORD mode.
It is very fast but does no interpretation on the read words at all.
You may use methods like word.asDouble() etc. for numeric conversion.foundArrayValue in class NdfHandlerjava.lang.ExceptionNdfHandler.foundArrayValue(NdfStructure, int, int, AsciiWord)public void doneArray(NdfStructure struct) throws java.lang.Exception
NdfHandlerdoneArray in class NdfHandlerjava.lang.ExceptionCopyright © 2013 EsprIT-Systems. All Rights Reserved.