Package org.openprovenance.prov.interop
Class Outputer
- java.lang.Object
-
- org.openprovenance.prov.interop.Outputer
-
- All Implemented Interfaces:
org.openprovenance.prov.interop.InteropMediaType
public class Outputer extends Object implements org.openprovenance.prov.interop.InteropMediaType
-
-
Field Summary
-
Fields inherited from interface org.openprovenance.prov.interop.InteropMediaType
ALL_PROV_INPUT_MEDIA_TYPES, ALL_PROV_OUTPUT_MEDIA_TYPES, EXTENSION_DOT, EXTENSION_JPEG, EXTENSION_JPG, EXTENSION_JSON, EXTENSION_JSONLD, EXTENSION_PDF, EXTENSION_PNG, EXTENSION_PROVN, EXTENSION_PROVX, EXTENSION_RDF, EXTENSION_SVG, EXTENSION_TRIG, EXTENSION_TTL, EXTENSION_XML, MEDIA_APPLICATION_FORM_URLENCODED, MEDIA_APPLICATION_JSON, MEDIA_APPLICATION_JSONLD, MEDIA_APPLICATION_PDF, MEDIA_APPLICATION_PROVENANCE_XML, MEDIA_APPLICATION_RDF_XML, MEDIA_APPLICATION_SQL, MEDIA_APPLICATION_TRIG, MEDIA_APPLICATION_XML, MEDIA_IMAGE_JPEG, MEDIA_IMAGE_PNG, MEDIA_IMAGE_SVG_XML, MEDIA_TEXT_CSV, MEDIA_TEXT_HTML, MEDIA_TEXT_PLAIN, MEDIA_TEXT_PROVENANCE_NOTATION, MEDIA_TEXT_TURTLE, MEDIA_TEXT_VND_GRAPHVIZ, MEDIA_TEXT_XML
-
-
Constructor Summary
Constructors Constructor Description Outputer(InteropFramework interopFramework, org.openprovenance.prov.model.ProvFactory pFactory)
-
Method Summary
Modifier and Type Method Description Map<org.openprovenance.prov.interop.Formats.ProvFormat,SerializerFunction>createSerializerMap()voidwriteDocument(OutputStream out, org.openprovenance.prov.model.Document document, String mediaType, boolean formatted)Serializes a document to a streamvoidwriteDocument(OutputStream os, org.openprovenance.prov.model.Document document, org.openprovenance.prov.interop.Formats.ProvFormat format)Write aDocumentto output stream, according to specifiedFormats.ProvFormatvoidwriteDocument(String filename, org.openprovenance.prov.model.Document document)Write aDocumentto file, serialized according to the file extensionvoidwriteDocument(String filename, org.openprovenance.prov.model.Document document, org.openprovenance.prov.interop.Formats.ProvFormat format)Write aDocumentto file, serialized according to the file extensionvoidwriteDocumentToFileOrDefaultOutput(String filename, org.openprovenance.prov.model.Document doc, String format)
-
-
-
Constructor Detail
-
Outputer
public Outputer(InteropFramework interopFramework, org.openprovenance.prov.model.ProvFactory pFactory)
-
-
Method Detail
-
writeDocument
public void writeDocument(String filename, org.openprovenance.prov.model.Document document)
Write aDocumentto file, serialized according to the file extension- Parameters:
filename- path of the file to write the Document todocument- aDocumentto serialize
-
writeDocumentToFileOrDefaultOutput
public void writeDocumentToFileOrDefaultOutput(String filename, org.openprovenance.prov.model.Document doc, String format) throws IOException
- Throws:
IOException
-
createSerializerMap
public final Map<org.openprovenance.prov.interop.Formats.ProvFormat,SerializerFunction> createSerializerMap()
-
writeDocument
public void writeDocument(OutputStream os, org.openprovenance.prov.model.Document document, org.openprovenance.prov.interop.Formats.ProvFormat format)
Write aDocumentto output stream, according to specifiedFormats.ProvFormat- Parameters:
os- anOutputStreamto write the Document todocument- aDocumentto serializeformat- aFormats.ProvFormat
-
writeDocument
public void writeDocument(String filename, org.openprovenance.prov.model.Document document, org.openprovenance.prov.interop.Formats.ProvFormat format)
Write aDocumentto file, serialized according to the file extension- Parameters:
filename- path of the file to write the Document todocument- aDocumentto serializeformat- aFormats.ProvFormatto serialize the document to
-
writeDocument
public void writeDocument(OutputStream out, org.openprovenance.prov.model.Document document, String mediaType, boolean formatted)
Serializes a document to a stream- Parameters:
out- anOutputStreamdocument- aDocumentmediaType- aStringrepresenting the media typeformatted- a boolean indicating whether the output should be pretty-printed
-
-