public class ParsingContextSnapshot extends ParsingContextWrapper
ParsingContext
which retains copies of variable attributes of a given ParsingContext
to
store the state of the parsing process at a given point in time. All runtime operations such as ContextWrapper.stop()
will still work and affect the current parsing process.context
Constructor and Description |
---|
ParsingContextSnapshot(ParsingContext context)
Creates a snapshot of a given
Context |
Modifier and Type | Method and Description |
---|---|
Map<Long,String> |
comments()
Returns all comments collected by the parser so far.
|
long |
currentChar()
Returns the index of the last char read from the input so far.
|
int |
currentColumn()
Returns the column index of the record being processed.
|
long |
currentLine()
Returns the current line of text being processed by the parser
|
String |
currentParsedContent()
Returns a String with the input character sequence parsed to produce the current record.
|
long |
currentRecord()
Returns the index of the last valid record parsed from the input
|
String |
lastComment()
Returns the last comment found in the input.
|
fieldContentOnError, lineSeparator, parsedHeaders, selectedHeaders, skipLines
columnsReordered, errorContentLength, extractedFieldIndexes, headers, indexOf, indexOf, isStopped, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
columnsReordered, extractedFieldIndexes, headers
public ParsingContextSnapshot(ParsingContext context)
Context
context
- the context object whose variable attributes will be copied over.public long currentLine()
ParsingContext
currentLine
in interface ParsingContext
currentLine
in class ParsingContextWrapper
public long currentChar()
ParsingContext
currentChar
in interface ParsingContext
currentChar
in class ParsingContextWrapper
public Map<Long,String> comments()
ParsingContext
CommonParserSettings.isCommentCollectionEnabled()
evaluates to false
.comments
in interface ParsingContext
comments
in class ParsingContextWrapper
public String lastComment()
ParsingContext
null
will be returned if CommonParserSettings.isCommentCollectionEnabled()
is evaluated to false
.lastComment
in interface ParsingContext
lastComment
in class ParsingContextWrapper
public int currentColumn()
Context
currentColumn
in interface Context
currentColumn
in class ContextWrapper<ParsingContext>
public String currentParsedContent()
ParsingContext
currentParsedContent
in interface ParsingContext
currentParsedContent
in class ParsingContextWrapper
public long currentRecord()
Context
currentRecord
in interface Context
currentRecord
in class ContextWrapper<ParsingContext>
Copyright © 2017 uniVocity Software Pty Ltd. All rights reserved.