Top Description Fields Constructors Methods
com.univocity.parsers.common

public Class ParsingContextSnapshot

extends ParsingContextWrapper
Class Inheritance
Imports
java.util.*

A snapshot of a 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 stop() will still work and affect the current parsing process.
Author
Univocity Software Pty Ltd - [email protected]

Field Summary

Modifier and TypeField and Description
private final Map<Long, String>
private final long
private final int
private final long
private final String
private final long
private final String

Constructor Summary

AccessConstructor and Description
public
ParsingContextSnapshot(ParsingContext
the context object whose variable attributes will be copied over.
context
)

Creates a snapshot of a given Context

Method Summary

Modifier and TypeMethod and Description
public Map<Long, String>
comments()

Overrides com.univocity.parsers.common.ParsingContextWrapper.comments.

Implements com.univocity.parsers.common.ParsingContext.comments.

Returns all comments collected by the parser so far.
public long
currentChar()

Overrides com.univocity.parsers.common.ParsingContextWrapper.currentChar.

Implements com.univocity.parsers.common.ParsingContext.currentChar.

Returns the index of the last char read from the input so far.
public int
currentColumn()

Overrides com.univocity.parsers.common.ContextWrapper.currentColumn.

Implements com.univocity.parsers.common.Context.currentColumn.

Returns the column index of the record being processed.
public long
currentLine()

Overrides com.univocity.parsers.common.ParsingContextWrapper.currentLine.

Implements com.univocity.parsers.common.ParsingContext.currentLine.

Returns the current line of text being processed by the parser
public String
currentParsedContent()

Overrides com.univocity.parsers.common.ParsingContextWrapper.currentParsedContent.

Implements com.univocity.parsers.common.ParsingContext.currentParsedContent.

Returns a String with the input character sequence parsed to produce the current record.
public long
currentRecord()

Overrides com.univocity.parsers.common.ContextWrapper.currentRecord.

Implements com.univocity.parsers.common.Context.currentRecord.

Returns the index of the last valid record parsed from the input
public String
Inherited from com.univocity.parsers.common.ParsingContextWrapper:
currentParsedContentLengthfieldContentOnErrorlineSeparatorparsedHeadersselectedHeadersskipLinestoRecord

Field Detail

commentsback to summary
private final Map<Long, String> comments
currentCharback to summary
private final long currentChar
currentColumnback to summary
private final int currentColumn
currentLineback to summary
private final long currentLine
currentParsedContentback to summary
private final String currentParsedContent
currentRecordback to summary
private final long currentRecord
lastCommentback to summary
private final String lastComment

Constructor Detail

ParsingContextSnapshotback to summary
public ParsingContextSnapshot(ParsingContext context)

Creates a snapshot of a given Context

Parameters
context:ParsingContext

the context object whose variable attributes will be copied over.

Method Detail

commentsback to summary
public Map<Long, String> comments()

Overrides com.univocity.parsers.common.ParsingContextWrapper.comments.

Implements com.univocity.parsers.common.ParsingContext.comments.

Doc from com.univocity.parsers.common.ParsingContext.comments.

Returns all comments collected by the parser so far. An empty map will be returned if CommonParserSettings#isCommentCollectionEnabled() evaluates to false.

Returns:Map<Long, String>

a map containing the line numbers and comments found in each.

Annotations
@Override
currentCharback to summary
public long currentChar()

Overrides com.univocity.parsers.common.ParsingContextWrapper.currentChar.

Implements com.univocity.parsers.common.ParsingContext.currentChar.

Doc from com.univocity.parsers.common.ParsingContext.currentChar.

Returns the index of the last char read from the input so far.

Returns:long

the index of the last char read from the input so far.

Annotations
@Override
currentColumnback to summary
public int currentColumn()

Overrides com.univocity.parsers.common.ContextWrapper.currentColumn.

Implements com.univocity.parsers.common.Context.currentColumn.

Doc from com.univocity.parsers.common.Context.currentColumn.

Returns the column index of the record being processed.

Returns:int

the column index of the record being processed.

Annotations
@Override
currentLineback to summary
public long currentLine()

Overrides com.univocity.parsers.common.ParsingContextWrapper.currentLine.

Implements com.univocity.parsers.common.ParsingContext.currentLine.

Doc from com.univocity.parsers.common.ParsingContext.currentLine.

Returns the current line of text being processed by the parser

Returns:long

current line of text being processed by the parser

Annotations
@Override
currentParsedContentback to summary
public String currentParsedContent()

Overrides com.univocity.parsers.common.ParsingContextWrapper.currentParsedContent.

Implements com.univocity.parsers.common.ParsingContext.currentParsedContent.

Doc from com.univocity.parsers.common.ParsingContext.currentParsedContent.

Returns a String with the input character sequence parsed to produce the current record.

Returns:String

the text content parsed for the current input record.

Annotations
@Override
currentRecordback to summary
public long currentRecord()

Overrides com.univocity.parsers.common.ContextWrapper.currentRecord.

Implements com.univocity.parsers.common.Context.currentRecord.

Doc from com.univocity.parsers.common.Context.currentRecord.

Returns the index of the last valid record parsed from the input

Returns:long

the index of the last valid record parsed from the input

Annotations
@Override
lastCommentback to summary
public String lastComment()

Overrides com.univocity.parsers.common.ParsingContextWrapper.lastComment.

Implements com.univocity.parsers.common.ParsingContext.lastComment.

Doc from com.univocity.parsers.common.ParsingContext.lastComment.

Returns the last comment found in the input. null will be returned if CommonParserSettings#isCommentCollectionEnabled() is evaluated to false.

Returns:String

the last comment found in the input.

Annotations
@Override