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 java.lang.Object implements SelectQueryResultWriter
- Since:
- 1.2
- Version:
- 6.0
- Author:
- Evren Sirin, Michael Grove
-
-
Field Summary
Fields Modifier and Type Field Description protected intmColCountprotected RDFValueColumn[]mColumnsprotected TextTabularOutputmExporterprotected java.io.PrintStreammOutprotected java.lang.Object[]mResult
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDataExporterQueryResultWriter(java.io.OutputStream theOut, Options theOptions, QueryResultFormat theFormat)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddNamespaces(java.lang.Iterable<Namespace> theNamespaces)protected abstract com.brsanthu.dataexporter.DataExportercreateExporter()Creates the exporter and sets its optionsvoidend()Signal that query processing has completedQueryResultFormatformat()Theformatthis writer will serialize output invoidhandle(BindingSet theBinding)Handle a result to a queryvoidlinks(java.util.List<java.lang.String> theList)Handle the set of links from the resultvoidnamespace(java.lang.String thePrefix, java.lang.String theIRI)voidstart()Indicates that writing has begun.voidvariables(java.util.List<java.lang.String> theSelectVars)The variables in the projection of the query
-
-
-
Field Detail
-
mOut
protected final java.io.PrintStream mOut
-
mExporter
protected TextTabularOutput mExporter
-
mColCount
protected int mColCount
-
mColumns
protected RDFValueColumn[] mColumns
-
mResult
protected java.lang.Object[] mResult
-
-
Constructor Detail
-
AbstractDataExporterQueryResultWriter
protected AbstractDataExporterQueryResultWriter(java.io.OutputStream theOut, Options theOptions, QueryResultFormat theFormat)
-
-
Method Detail
-
format
@Nonnull public QueryResultFormat format()
Theformatthis writer will serialize output in- Specified by:
formatin interfaceQueryResultWriter<BindingSet>- Returns:
- the format
-
links
public void links(@Nonnull java.util.List<java.lang.String> theList)Handle the set of links from the result- Specified by:
linksin interfaceQueryResultHandler<BindingSet>- Specified by:
linksin interfaceQueryResultWriter<BindingSet>- Parameters:
theList- 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<BindingSet>- Throws:
ResultWritingFailed
-
addNamespaces
public void addNamespaces(java.lang.Iterable<Namespace> theNamespaces)
-
start
public void start()
Indicates that writing has begun.- Specified by:
startin interfaceQueryResultHandler<BindingSet>- Specified by:
startin interfaceQueryResultWriter<BindingSet>
-
variables
public void variables(@Nonnull java.util.List<java.lang.String> theSelectVars)The variables in the projection of the query- Specified by:
variablesin interfaceSelectQueryResultHandler- Parameters:
theSelectVars- the variables- See Also:
SelectQueryResult.variables()
-
handle
public void handle(@Nonnull BindingSet theBinding)Handle a result to a query- Specified by:
handlein interfaceQueryResultHandler<BindingSet>- Specified by:
handlein interfaceQueryResultWriter<BindingSet>- Parameters:
theBinding- the result
-
end
public void end()
Signal that query processing has completed- Specified by:
endin interfaceQueryResultHandler<BindingSet>- Specified by:
endin interfaceQueryResultWriter<BindingSet>
-
createExporter
protected abstract com.brsanthu.dataexporter.DataExporter createExporter()
Creates the exporter and sets its options- Returns:
- a DataExporter object
-
-