Package com.stardog.stark.io

# Class LineSupplierParserContext

java.lang.Object
com.stardog.stark.io.AbstractRDFHandler
com.stardog.stark.io.ParserContext
com.stardog.stark.io.IOParserContext
com.stardog.stark.io.LineSupplierParserContext

All Implemented Interfaces:
  `RDFHandler`

public class LineSupplierParserContext extends IOParserContext
Extends `IOParserContext` to read the input from a `LineSupplier` instead of an input stream. Since two batches retrieved from a `LineSupplier` might not be consecutive (the batch in between might be retrieved by another thread) this context in its current form is only suitable for parsing NTriples and NQuads where a triple cannot span multiple lines.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class com.stardog.stark.io.ParserContext

  `ParserContext.ParseError`

- ## Field Summary

  ### Fields inherited from class com.stardog.stark.io.ParserContext

  `BNODE_ID_PREFIX, caseInsensitiveDirectives, mBaseIRI, mColumnNumber, mContext, mLineNumber, mNamespaces, mObject, mPredicate, mSubject`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LineSupplierParserContext(Supplier<LineBatch> theInput, RDFHandler theHandler, Options theOptions)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `readCodePoint()`
  Reads the next Unicode code point.
  `void`
  `unread(int theCodePoint)`
  Pushes back a single code point by copying it to the front of the buffer.
  `void`
  `unread(String theStr)`
  Pushes back the supplied string by copying it to the front of the buffer.

  ### Methods inherited from class com.stardog.stark.io.IOParserContext

  `datatypeBuffer, langBuffer, peekCodePoint, resetSB, trimSB, verifyCharacterOrFail, verifyCharacterOrFail, verifyCharacterOrFail`

  ### Methods inherited from class com.stardog.stark.io.ParserContext

  `createBNode, createBNode, createLiteral, currentStatement, end, error, error, getRandomBnodeIdPrefix, handle, is, namespace, namespace, reportStatement, resetStatement, resolveURI, start`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### LineSupplierParserContext

    public LineSupplierParserContext(@Nonnull Supplier<LineBatch> theInput, @Nonnull RDFHandler theHandler, @Nonnull Options theOptions)

- ## Method Details

  - ### readCodePoint

    public int readCodePoint() throws IOException
    Description copied from class: `IOParserContext`
    Reads the next Unicode code point.
    Overrides:
      `readCodePoint` in class `IOParserContext`
    Returns:
      the next Unicode code point, or -1 if the end of the stream has been reached.
    Throws:
      `IOException`

  - ### unread

    public void unread(int theCodePoint)
    Description copied from class: `IOParserContext`
    Pushes back a single code point by copying it to the front of the buffer. After this method returns, a call to `IOParserContext.readCodePoint()` will return the same code point c again.
    Overrides:
      `unread` in class `IOParserContext`
    Parameters:
      `theCodePoint` - a single Unicode code point.

  - ### unread

    public void unread(@Nonnull String theStr)
    Description copied from class: `IOParserContext`
    Pushes back the supplied string by copying it to the front of the buffer. After this method returns, successive calls to `IOParserContext.readCodePoint()` will return the code points in the supplied string again, starting at the first in the String..
    Overrides:
      `unread` in class `IOParserContext`
    Parameters:
      `theStr` - the string to un-read.