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
ExtendsIOParserContext
to read the input from aLineSupplier
instead of an input stream. Since two batches retrieved from aLineSupplier
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(java.util.function.Supplier<LineBatch> theInput, RDFHandler theHandler, Options theOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods 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(java.lang.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
-
-
-
-
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 classIOParserContext
- 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 toIOParserContext.readCodePoint()
will return the same code point c again.- Overrides:
unread
in classIOParserContext
- 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 toIOParserContext.readCodePoint()
will return the code points in the supplied string again, starting at the first in the String..- Overrides:
unread
in classIOParserContext
- Parameters:
theStr
- the string to un-read.
-
-