Package com.stardog.stark.query.io.json
Class AbstractSPARQLJSONWriter<T>
- java.lang.Object
-
- com.stardog.stark.query.io.json.AbstractSPARQLJSONWriter<T>
-
- All Implemented Interfaces:
QueryResultWriter<T>,QueryResultHandler<T>
- Direct Known Subclasses:
SPARQLJSONBooleanResultWriter,SPARQLJSONSelectResultWriter
public abstract class AbstractSPARQLJSONWriter<T> extends java.lang.Object implements QueryResultWriter<T>
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Michael Grove
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandocumentOpenprotected booleanfirstTupleWrittenprotected booleanheaderCompleteprotected booleanheaderOpenprotected com.fasterxml.jackson.core.JsonGeneratorjgprotected booleanlinksFoundprotected OptionsmOptionsprotected booleantupleVariablesFound
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSPARQLJSONWriter(java.io.OutputStream theOutput, Options theOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidend()Signal that query processing has completedprotected voidendHeader()QueryResultFormatformat()Theformatthis writer will serialize output invoidlinks(java.util.List<java.lang.String> theLinks)Handle the set of links from the resultvoidnamespace(java.lang.String thePrefix, java.lang.String theIRI)voidstart()Indicates that writing has begun.protected voidstartHeader()protected voidwriteHeaderFields()protected voidwriteValue(Value value)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.stardog.stark.query.io.QueryResultWriter
handle
-
-
-
-
Field Detail
-
jg
protected final com.fasterxml.jackson.core.JsonGenerator jg
-
mOptions
protected final Options mOptions
-
firstTupleWritten
protected boolean firstTupleWritten
-
documentOpen
protected boolean documentOpen
-
headerOpen
protected boolean headerOpen
-
headerComplete
protected boolean headerComplete
-
tupleVariablesFound
protected boolean tupleVariablesFound
-
linksFound
protected boolean linksFound
-
-
Constructor Detail
-
AbstractSPARQLJSONWriter
protected AbstractSPARQLJSONWriter(@Nonnull java.io.OutputStream theOutput, @Nonnull Options theOptions)
-
-
Method Detail
-
start
public void start()
Indicates that writing has begun.- Specified by:
startin interfaceQueryResultHandler<T>- Specified by:
startin interfaceQueryResultWriter<T>
-
links
public void links(@Nonnull java.util.List<java.lang.String> theLinks)Handle the set of links from the result- Specified by:
linksin interfaceQueryResultHandler<T>- Specified by:
linksin interfaceQueryResultWriter<T>- Parameters:
theLinks- The links- See Also:
- "link"
-
namespace
public void namespace(@Nonnull java.lang.String thePrefix, @Nonnull java.lang.String theIRI) throws ResultWritingFailed- Specified by:
namespacein interfaceQueryResultWriter<T>- Throws:
ResultWritingFailed
-
end
public void end()
Signal that query processing has completed- Specified by:
endin interfaceQueryResultHandler<T>- Specified by:
endin interfaceQueryResultWriter<T>
-
startHeader
protected void startHeader()
-
writeHeaderFields
protected void writeHeaderFields() throws java.io.IOException- Throws:
java.io.IOException
-
endHeader
protected void endHeader()
-
writeValue
protected void writeValue(@Nonnull Value value) throws java.io.IOException- Throws:
java.io.IOException
-
format
@Nonnull public QueryResultFormat format()
Theformatthis writer will serialize output in- Specified by:
formatin interfaceQueryResultWriter<T>- Returns:
- the format
-
-