Package com.complexible.common.rdf.query.resultio

# Class AbstractDataExporterQueryResultWriter

java.lang.Object
com.complexible.common.rdf.query.resultio.AbstractDataExporterQueryResultWriter

All Implemented Interfaces:
  `QueryResultWriter<BindingSet>`, `SelectQueryResultWriter`, `QueryResultHandler<BindingSet>`, `SelectQueryResultHandler`

Direct Known Subclasses:
  `HTMLQueryResultWriter`, `TextTableQueryResultWriter`

public abstract class AbstractDataExporterQueryResultWriter extends Object implements SelectQueryResultWriter

Since:
  1.2
Version:
  6.0
Author:
  Evren Sirin, Michael Grove

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected int`
  `mColCount`
  `protected RDFValueColumn[]`
  `mColumns`
  `protected TextTabularOutput`
  `mExporter`
  `protected final PrintStream`
  `mOut`
  `protected Object[]`
  `mResult`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractDataExporterQueryResultWriter(OutputStream theOut, Options theOptions, QueryResultFormat theFormat)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addNamespaces(Iterable<Namespace> theNamespaces)`
  `protected abstract com.brsanthu.dataexporter.DataExporter`
  `createExporter()`
  Creates the exporter and sets its options
  `void`
  `end()`
  Signal that query processing has completed
  `QueryResultFormat`
  `format()`
  The `format` this writer will serialize output in
  `void`
  `handle(BindingSet theBinding)`
  Handle a result to a query
  `void`
  `links(List<String> theList)`
  Handle the set of links from the result
  `void`
  `namespace(String thePrefix, String theIRI)`
  `void`
  `start()`
  Indicates that writing has begun.
  `void`
  `variables(List<String> theSelectVars)`
  The variables in the projection of the query

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### mOut

    protected final PrintStream mOut

  - ### mExporter

    protected TextTabularOutput mExporter

  - ### mColCount

    protected int mColCount

  - ### mColumns

    protected RDFValueColumn[] mColumns

  - ### mResult

    protected Object[] mResult

- ## Constructor Details

  - ### AbstractDataExporterQueryResultWriter

    protected AbstractDataExporterQueryResultWriter(OutputStream theOut, Options theOptions, QueryResultFormat theFormat)

- ## Method Details

  - ### format

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

  - ### links

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

  - ### namespace

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

  - ### addNamespaces

    public void addNamespaces(Iterable<Namespace> theNamespaces)

  - ### start

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

  - ### variables

    public void variables(@Nonnull List<String> theSelectVars)
    The variables in the projection of the query
    Specified by:
      `variables` in interface `SelectQueryResultHandler`
    Parameters:
      `theSelectVars` - the variables
    See Also:
      - `SelectQueryResult.variables()`

  - ### handle

    public void handle(@Nonnull BindingSet theBinding)
    Handle a result to a query
    Specified by:
      `handle` in interface `QueryResultHandler<BindingSet>`
    Specified by:
      `handle` in interface `QueryResultWriter<BindingSet>`
    Parameters:
      `theBinding` - the result

  - ### end

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

  - ### createExporter

    protected abstract com.brsanthu.dataexporter.DataExporter createExporter()
    Creates the exporter and sets its options
    Returns:
      a DataExporter object