public final class NdfParser extends AsciiParser<ApplicationContext> implements NdfConstants, NdfParseControl
NdfHandler
about every structure and property it has
found in the NDF source file. Note that NDF data is read in streaming mode such that
not much memory is needed during parsing. It is the job of the attached custom
NdfHandler
to interpret and collect the data.Modifier and Type | Field and Description |
---|---|
protected NdfProperties |
headerProps |
currentLine, DEFAULT_BUFF_SIZE
childTaskRef, isTestMode, monitorController, resultRef, stateFlag
allowedInNames, blockCommentChar, booleanFalseChar, booleanFalseLiteral, booleanTrueChar, booleanTrueLiteral, currentNdfDocVersion, defaultTextEndChar, defaultTextParagraphChar, lineCommentChar, ndfDocAuthorKey, ndfDocCreatedKey, ndfDocEncodingKey, ndfDocTypeKey, ndfDocVersionKey, nullLiteral, quotingBreakCodes, standardBreakCodes, structureChar, textValueBreakCodes, validTextBreakSymbols
Constructor and Description |
---|
NdfParser(ApplicationContext ctx,
FileInfo fileInfo,
java.io.InputStream stream,
NdfHandler handler) |
NdfParser(ApplicationContext ctx,
FileInfo fileInfo,
java.io.InputStream stream,
NdfHandler handler,
int buffSize) |
NdfParser(ApplicationContext ctx,
java.io.File file,
NdfHandler handler) |
NdfParser(ApplicationContext ctx,
java.io.File file,
NdfHandler handler,
int buffSize) |
NdfParser(ApplicationContext ctx,
ProgressFileInputStream progressStream,
NdfHandler handler) |
NdfParser(ApplicationContext ctx,
ProgressInputStream progressStream,
NdfHandler handler) |
Modifier and Type | Method and Description |
---|---|
int |
getCurrentNestingLevel()
Returns the current nesting level.
|
NdfStructure |
getCurrentStructure()
Returns the current structure in process.
|
int |
getMaxNestingLevel()
Returns the deepest nesting level reached so far during parsing
the document.
|
long |
getParseDuration()
Returns the parsing duration in millis after parsing has been executed.
|
protected void |
performRead() |
void |
setNotifyAllProperties(boolean notifyAll)
By default only properties on top level are notified because all other
properties obtain to particular structures.
|
createAsciiLine, getNextLine, nextLine, nextWord, setBlockCommentChar, setBreakCodes
checkedByte, close, createFileInputStream, executeAsync, getCurrentToRestOfLine, getCurrentWord, getFileInfo, getLineNumber, getNextWord, getReadByteCount, getReadOperationCount, getRestOfLine, isEndOfLineReached, nextDouble, nextInt, nextLong, nextShort, nextString, openFile, setEncoding, setLineCommentChar, skipLines, skipRestOfLine, skipWords
addMonitor, checkCancelled, checkForErrorAndRethrow, clearMonitors, createRunStateFlag, doOnCancel, doOnFailure, execute, executeSubTask, getError, getMaxProgressSteps, getMonitorCount, getMonitors, getName, getProgressStepCount, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, handleFinish, handleStart, handleSuccess, hasError, hasMonitor, isCancellable, notifyProceeded, registerTaskStateChange, removeMonitor, resetProgress, setCancellable, setLogLevel, setMaxProgressSteps, setMonitor, setName, setName, setResult, setRunStateFlag, setTaskId, setType, shouldFireMonitor, sleepChecked, wasCancelled
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getApplicationContext
getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
protected NdfProperties headerProps
public NdfParser(ApplicationContext ctx, java.io.File file, NdfHandler handler) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public NdfParser(ApplicationContext ctx, java.io.File file, NdfHandler handler, int buffSize) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public NdfParser(ApplicationContext ctx, ProgressInputStream progressStream, NdfHandler handler)
public NdfParser(ApplicationContext ctx, ProgressFileInputStream progressStream, NdfHandler handler)
public NdfParser(ApplicationContext ctx, FileInfo fileInfo, java.io.InputStream stream, NdfHandler handler)
public NdfParser(ApplicationContext ctx, FileInfo fileInfo, java.io.InputStream stream, NdfHandler handler, int buffSize)
public void setNotifyAllProperties(boolean notifyAll)
NdfHandler.foundProperties(NdfStructure, NdfProperties)
to be
called for all properties no matter on which nesting level they were found.public NdfStructure getCurrentStructure()
NdfParseControl
getCurrentStructure
in interface NdfParseControl
public int getCurrentNestingLevel()
NdfParseControl
getCurrentNestingLevel
in interface NdfParseControl
public int getMaxNestingLevel()
NdfParseControl
getMaxNestingLevel
in interface NdfParseControl
public long getParseDuration()
protected final void performRead() throws java.lang.Exception
performRead
in class AbstractAsciiParser<ApplicationContext,AsciiLine>
java.lang.Exception
Copyright © 2014 EsprIT-Systems. All Rights Reserved.