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, setLogChannel
public boolean acceptDocumentVersion(java.lang.String documentVersion)
acceptDocumentVersion
in class NdfHandler
public void startDocument(FileInfo fileInfo, NdfProperties props) throws java.lang.Exception
NdfHandler
startDocument
in class NdfHandler
props
- the header properties found in the documentjava.lang.Exception
public void doneDocument() throws java.lang.Exception
NdfHandler
doneDocument
in class NdfHandler
java.lang.Exception
public void startProperty(java.lang.String key) throws java.lang.Exception
NdfHandler
startProperty
in class NdfHandler
java.lang.Exception
NdfHandler.doneProperty(String, String)
public void doneProperty(java.lang.String key, java.lang.String value) throws java.lang.Exception
NdfHandler
doneProperty
in class NdfHandler
java.lang.Exception
NdfHandler.startProperty(String)
public void doneProperty(java.lang.String key, java.util.List<java.lang.String> valueList) throws java.lang.Exception
NdfHandler
doneProperty
in class NdfHandler
java.lang.Exception
public void foundHeaderProperties(NdfProperties props) throws java.lang.Exception
NdfHandler
foundHeaderProperties
in class NdfHandler
java.lang.Exception
public NotifyBodyText startObject(NdfStructure struct, NdfProperties props) throws java.lang.Exception
NdfHandler
NdfHandler.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 NdfHandler
java.lang.Exception
public void foundBodyText(NdfStructure struct, java.util.List<java.lang.String> lines) throws java.lang.Exception
NdfHandler
NdfHandler.startObject(NdfStructure, NdfProperties)
returned
NotifyBodyText.SKIP
.foundBodyText
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
NdfHandler.foundTableRow(NdfStructure, int, NdfProperties)
will be called.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
mode.
It is quite expensive because it parses values the same way as property values.foundTableRow
in class NdfHandler
java.lang.Exception
NdfHandler.foundTableCell(NdfStructure, int, int, AsciiWord)
public void foundTableRow(NdfStructure struct, int rowIndex, NdfProperties rowProps) throws java.lang.Exception
NdfHandler
NotifyTableValue.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 NdfHandler
java.lang.Exception
NdfHandler.foundTableCell(NdfStructure, int, int, AsciiWord)
public void foundTableCell(NdfStructure struct, int rowIndex, int columnIndex, AsciiWord data) throws java.lang.Exception
NdfHandler
NotifyTableValue.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 NdfHandler
java.lang.Exception
NdfHandler.foundTableRow(NdfStructure, int, String[])
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
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
mode.
It is quite expensive because it parses values the same way as property values.foundArrayValue
in class NdfHandler
java.lang.Exception
NdfHandler.foundArrayValue(NdfStructure, int, int, AsciiWord)
public void foundArrayValue(NdfStructure struct, int dimension, int index, AsciiWord word) throws java.lang.Exception
NdfHandler
NotifyArrayValue.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 NdfHandler
java.lang.Exception
NdfHandler.foundArrayValue(NdfStructure, int, int, AsciiWord)
public void doneArray(NdfStructure struct) throws java.lang.Exception
NdfHandler
doneArray
in class NdfHandler
java.lang.Exception
Copyright © 2013 EsprIT-Systems. All Rights Reserved.