Class 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)  
    • 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 a Document to file, serialized according to the file extension
        Parameters:
        filename - path of the file to write the Document to
        document - a Document to 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 a Document to output stream, according to specified Formats.ProvFormat
        Parameters:
        os - an OutputStream to write the Document to
        document - a Document to serialize
        format - a Formats.ProvFormat
      • writeDocument

        public void writeDocument​(String filename,
                                  org.openprovenance.prov.model.Document document,
                                  org.openprovenance.prov.interop.Formats.ProvFormat format)
        Write a Document to file, serialized according to the file extension
        Parameters:
        filename - path of the file to write the Document to
        document - a Document to serialize
        format - a Formats.ProvFormat to 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 - an OutputStream
        document - a Document
        mediaType - a String representing the media type
        formatted - a boolean indicating whether the output should be pretty-printed