Class 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.
    • Constructor Detail

      • LineSupplierParserContext

        public LineSupplierParserContext​(@Nonnull
                                         java.util.function.Supplier<LineBatch> theInput,
                                         @Nonnull
                                         RDFHandler theHandler,
                                         @Nonnull
                                         Options theOptions)
    • Method Detail

      • readCodePoint

        public int readCodePoint()
                          throws java.io.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:
        java.io.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
                           java.lang.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.