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.| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.Long,java.lang.String> |
comments |
private long |
currentChar |
private int |
currentColumn |
private long |
currentLine |
private java.lang.String |
currentParsedContent |
private long |
currentRecord |
private java.lang.String |
lastComment |
context| Constructor and Description |
|---|
ParsingContextSnapshot(ParsingContext context)
Creates a snapshot of a given
Context |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.Long,java.lang.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
|
java.lang.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
|
java.lang.String |
lastComment()
Returns the last comment found in the input.
|
currentParsedContentLength, fieldContentOnError, lineSeparator, parsedHeaders, selectedHeaders, skipLines, toRecordcolumnsReordered, errorContentLength, extractedFieldIndexes, headers, indexOf, indexOf, isStopped, recordMetaData, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcolumnsReordered, extractedFieldIndexes, headerserrorContentLength, indexOf, indexOf, isStopped, recordMetaData, stopprivate final long currentLine
private final long currentChar
private final java.util.Map<java.lang.Long,java.lang.String> comments
private final java.lang.String lastComment
private final int currentColumn
private final java.lang.String currentParsedContent
private final long currentRecord
public ParsingContextSnapshot(ParsingContext context)
Contextcontext - the context object whose variable attributes will be copied over.public long currentLine()
ParsingContextcurrentLine in interface ParsingContextcurrentLine in class ParsingContextWrapperpublic long currentChar()
ParsingContextcurrentChar in interface ParsingContextcurrentChar in class ParsingContextWrapperpublic java.util.Map<java.lang.Long,java.lang.String> comments()
ParsingContextCommonParserSettings.isCommentCollectionEnabled() evaluates to false.comments in interface ParsingContextcomments in class ParsingContextWrapperpublic java.lang.String lastComment()
ParsingContextnull will be returned if CommonParserSettings.isCommentCollectionEnabled() is evaluated to false.lastComment in interface ParsingContextlastComment in class ParsingContextWrapperpublic int currentColumn()
ContextcurrentColumn in interface ContextcurrentColumn in class ContextWrapper<ParsingContext>public java.lang.String currentParsedContent()
ParsingContextcurrentParsedContent in interface ParsingContextcurrentParsedContent in class ParsingContextWrapperpublic long currentRecord()
ContextcurrentRecord in interface ContextcurrentRecord in class ContextWrapper<ParsingContext>