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
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
ConstructorsConstructorDescriptionLineSupplierParserContext(Supplier<LineBatch> theInput, RDFHandler theHandler, Options theOptions) -
Method Summary
Modifier and TypeMethodDescriptionintReads the next Unicode code point.voidunread(int theCodePoint) Pushes back a single code point by copying it to the front of the buffer.voidPushes 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, verifyCharacterOrFailMethods 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 Details
-
LineSupplierParserContext
public LineSupplierParserContext(@Nonnull Supplier<LineBatch> theInput, @Nonnull RDFHandler theHandler, @Nonnull Options theOptions)
-
-
Method Details
-
readCodePoint
Description copied from class:IOParserContextReads the next Unicode code point.- Overrides:
readCodePointin classIOParserContext- 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:IOParserContextPushes 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:
unreadin classIOParserContext- Parameters:
theCodePoint- a single Unicode code point.
-
unread
Description copied from class:IOParserContextPushes 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:
unreadin classIOParserContext- Parameters:
theStr- the string to un-read.
-