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 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 final com.fasterxml.jackson.core.JsonGenerator`
  `jg`
  `protected boolean`
  `linksFound`
  `protected final Options`
  `mOptions`
  `protected boolean`
  `tupleVariablesFound`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractSPARQLJSONWriter(OutputStream theOutput, Options theOptions)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `end()`
  Signal that query processing has completed
  `protected void`
  `endHeader()`
  `QueryResultFormat`
  `format()`
  The `format` this writer will serialize output in
  `void`
  `links(List<String> theLinks)`
  Handle the set of links from the result
  `void`
  `namespace(String thePrefix, String theIRI)`
  `void`
  `start()`
  Indicates that writing has begun.
  `protected void`
  `startHeader()`
  `protected void`
  `writeHeaderFields()`
  `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 Details

  - ### 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 Details

  - ### AbstractSPARQLJSONWriter

    protected AbstractSPARQLJSONWriter(@Nonnull OutputStream theOutput, @Nonnull Options theOptions)

- ## Method Details

  - ### start

    public void start()
    Indicates that writing has begun.
    Specified by:
      `start` in interface `QueryResultHandler<T>`
    Specified by:
      `start` in interface `QueryResultWriter<T>`

  - ### links

    public void links(@Nonnull List<String> theLinks)
    Handle the set of links from the result
    Specified by:
      `links` in interface `QueryResultHandler<T>`
    Specified by:
      `links` in interface `QueryResultWriter<T>`
    Parameters:
      `theLinks` - The links
    See Also:
      - "link"

  - ### namespace

    public void namespace(@Nonnull String thePrefix, @Nonnull String theIRI) throws ResultWritingFailed
    Specified by:
      `namespace` in interface `QueryResultWriter<T>`
    Throws:
      `ResultWritingFailed`

  - ### end

    public void end()
    Signal that query processing has completed
    Specified by:
      `end` in interface `QueryResultHandler<T>`
    Specified by:
      `end` in interface `QueryResultWriter<T>`

  - ### startHeader

    protected void startHeader()

  - ### writeHeaderFields

    protected void writeHeaderFields() throws IOException
    Throws:
      `IOException`

  - ### endHeader

    protected void endHeader()

  - ### writeValue

    protected void writeValue(@Nonnull Value value) throws IOException
    Throws:
      `IOException`

  - ### format

    @Nonnull public QueryResultFormat format()
    The `format` this writer will serialize output in
    Specified by:
      `format` in interface `QueryResultWriter<T>`
    Returns:
      the format