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 int
mColCount
protected RDFValueColumn[]
mColumns
protected TextTabularOutput
mExporter
protected java.io.PrintStream
mOut
protected java.lang.Object[]
mResult
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDataExporterQueryResultWriter(java.io.OutputStream theOut, Options theOptions, QueryResultFormat theFormat)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addNamespaces(java.lang.Iterable<Namespace> theNamespaces)
protected abstract com.brsanthu.dataexporter.DataExporter
createExporter()
Creates the exporter and sets its optionsvoid
end()
Signal that query processing has completedQueryResultFormat
format()
Theformat
this writer will serialize output invoid
handle(BindingSet theBinding)
Handle a result to a queryvoid
links(java.util.List<java.lang.String> theList)
Handle the set of links from the resultvoid
namespace(java.lang.String thePrefix, java.lang.String theIRI)
void
start()
Indicates that writing has begun.void
variables(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()
Theformat
this writer will serialize output in- Specified by:
format
in 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:
links
in interfaceQueryResultHandler<BindingSet>
- Specified by:
links
in 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:
namespace
in interfaceQueryResultWriter<BindingSet>
- Throws:
ResultWritingFailed
-
addNamespaces
public void addNamespaces(java.lang.Iterable<Namespace> theNamespaces)
-
start
public void start()
Indicates that writing has begun.- Specified by:
start
in interfaceQueryResultHandler<BindingSet>
- Specified by:
start
in interfaceQueryResultWriter<BindingSet>
-
variables
public void variables(@Nonnull java.util.List<java.lang.String> theSelectVars)
The variables in the projection of the query- Specified by:
variables
in interfaceSelectQueryResultHandler
- 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 interfaceQueryResultHandler<BindingSet>
- Specified by:
handle
in interfaceQueryResultWriter<BindingSet>
- Parameters:
theBinding
- the result
-
end
public void end()
Signal that query processing has completed- Specified by:
end
in interfaceQueryResultHandler<BindingSet>
- Specified by:
end
in interfaceQueryResultWriter<BindingSet>
-
createExporter
protected abstract com.brsanthu.dataexporter.DataExporter createExporter()
Creates the exporter and sets its options- Returns:
- a DataExporter object
-
-