MARMOTTA-204: updated json-ld writer to be fully compliant with sesame 2.7.0
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/0458350e Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/0458350e Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/0458350e Branch: refs/heads/develop Commit: 0458350e6d02096b91da77f48c22b685906efdfb Parents: c5b5262 Author: Sergio Fernández <[email protected]> Authored: Wed Apr 17 09:01:50 2013 +0200 Committer: Sergio Fernández <[email protected]> Committed: Wed Apr 17 09:01:50 2013 +0200 ---------------------------------------------------------------------- .../commons/sesame/rio/jsonld/JsonLdWriter.java | 43 ++++++++++++++- 1 files changed, 41 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/0458350e/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java ---------------------------------------------------------------------- diff --git a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java index c788c85..863887b 100644 --- a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java +++ b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java @@ -22,11 +22,15 @@ import org.openrdf.model.Statement; import org.openrdf.rio.RDFFormat; import org.openrdf.rio.RDFHandlerException; import org.openrdf.rio.RDFWriter; +import org.openrdf.rio.RioSetting; +import org.openrdf.rio.WriterConfig; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; +import java.util.ArrayList; +import java.util.Collection; /** * Add file description here! @@ -35,9 +39,9 @@ import java.io.Writer; */ public class JsonLdWriter implements RDFWriter { - private PrintWriter writer; - + private WriterConfig config; + SesameJSONLDSerializer serializer; public JsonLdWriter(OutputStream out) { @@ -122,5 +126,40 @@ public class JsonLdWriter implements RDFWriter { */ @Override public void handleComment(String comment) throws RDFHandlerException { + } + + /** + * @return A collection of {@link RioSetting}s that are supported by this + * RDFWriter. + * @since 2.7.0 + */ + @Override + public Collection<RioSetting<?>> getSupportedSettings() { + return new ArrayList<RioSetting<?>>(); + } + + /** + * Retrieves the current writer configuration as a single object. + * + * @return a writer configuration object representing the current + * configuration of the writer. + * @since 2.7.0 + */ + @Override + public WriterConfig getWriterConfig() { + return config; + } + + /** + * Sets all supplied writer configuration options. + * + * @param config + * a writer configuration object. + * @since 2.7.0 + */ + @Override + public void setWriterConfig(WriterConfig config) { + this.config = config; + } }
