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
ExtendsIOParserContextto read the input from aLineSupplierinstead of an input stream. Since two batches retrieved from aLineSuppliermight 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 intreadCodePoint()Reads the next Unicode code point.voidunread(int theCodePoint)Pushes back a single code point by copying it to the front of the buffer.voidunread(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.IOExceptionDescription 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:
java.io.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
public void unread(@Nonnull java.lang.String theStr)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.
-
-