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 boolean
documentOpen
protected boolean
firstTupleWritten
protected boolean
headerComplete
protected boolean
headerOpen
protected com.fasterxml.jackson.core.JsonGenerator
jg
protected boolean
linksFound
protected Options
mOptions
protected boolean
tupleVariablesFound
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSPARQLJSONWriter(java.io.OutputStream theOutput, Options theOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
end()
Signal that query processing has completedprotected void
endHeader()
QueryResultFormat
format()
Theformat
this writer will serialize output invoid
links(java.util.List<java.lang.String> theLinks)
Handle the set of links from the resultvoid
namespace(java.lang.String thePrefix, java.lang.String theIRI)
void
start()
Indicates that writing has begun.protected void
startHeader()
protected void
writeValue(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:
start
in interfaceQueryResultHandler<T>
- Specified by:
start
in interfaceQueryResultWriter<T>
-
links
public void links(@Nonnull java.util.List<java.lang.String> theLinks)
Handle the set of links from the result- Specified by:
links
in interfaceQueryResultHandler<T>
- Specified by:
links
in 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:
namespace
in interfaceQueryResultWriter<T>
- Throws:
ResultWritingFailed
-
end
public void end()
Signal that query processing has completed- Specified by:
end
in interfaceQueryResultHandler<T>
- Specified by:
end
in interfaceQueryResultWriter<T>
-
startHeader
protected void startHeader()
-
endHeader
protected void endHeader()
-
writeValue
protected void writeValue(@Nonnull Value value) throws java.io.IOException
- Throws:
java.io.IOException
-
format
@Nonnull public QueryResultFormat format()
Theformat
this writer will serialize output in- Specified by:
format
in interfaceQueryResultWriter<T>
- Returns:
- the format
-
-