org.openprovenance.model
Class OPMSerialiser

java.lang.Object
  extended by org.openprovenance.model.OPMSerialiser

public class OPMSerialiser
extends Object

Serialiser of OPM Graphs.


Field Summary
static String defaultNamespace
           
protected  javax.xml.bind.JAXBContext jc
           
protected  boolean usePrefixMapper
           
 
Constructor Summary
OPMSerialiser()
           
OPMSerialiser(boolean usePrefixMapper)
           
OPMSerialiser(boolean usePrefixMapper, String packageList)
           
OPMSerialiser(String packageList)
           
 
Method Summary
 void configurePrefixes(javax.xml.bind.Marshaller m)
           
 Document defaultEmptyDocument()
          By default we use a document provided by the DocumentBuilder factory.
static OPMSerialiser getThreadOPMSerialiser()
           
 void serialiseOPMGraph(File file, OPMGraph graph, boolean format)
           
 Node serialiseOPMGraph(Node addTo, OPMGraph graph)
           
 Document serialiseOPMGraph(OPMGraph request)
           
 String serialiseOPMGraph(StringWriter sw, OPMGraph graph)
           
 String serialiseOPMGraph(StringWriter sw, OPMGraph graph, boolean format)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jc

protected javax.xml.bind.JAXBContext jc

defaultNamespace

public static String defaultNamespace

usePrefixMapper

protected final boolean usePrefixMapper
Constructor Detail

OPMSerialiser

public OPMSerialiser()
              throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

OPMSerialiser

public OPMSerialiser(boolean usePrefixMapper)
              throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

OPMSerialiser

public OPMSerialiser(String packageList)
              throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

OPMSerialiser

public OPMSerialiser(boolean usePrefixMapper,
                     String packageList)
              throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException
Method Detail

getThreadOPMSerialiser

public static OPMSerialiser getThreadOPMSerialiser()

configurePrefixes

public void configurePrefixes(javax.xml.bind.Marshaller m)
                       throws javax.xml.bind.PropertyException
Throws:
javax.xml.bind.PropertyException

serialiseOPMGraph

public Document serialiseOPMGraph(OPMGraph request)
                           throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

serialiseOPMGraph

public Node serialiseOPMGraph(Node addTo,
                              OPMGraph graph)
                       throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

serialiseOPMGraph

public String serialiseOPMGraph(StringWriter sw,
                                OPMGraph graph)
                         throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

serialiseOPMGraph

public String serialiseOPMGraph(StringWriter sw,
                                OPMGraph graph,
                                boolean format)
                         throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

serialiseOPMGraph

public void serialiseOPMGraph(File file,
                              OPMGraph graph,
                              boolean format)
                       throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

defaultEmptyDocument

public Document defaultEmptyDocument()
By default we use a document provided by the DocumentBuilder factory. If this functionality is required, PStructureSerialiser needs to be subclassed and the defaultEmptyDocument method overriden.



Copyright © 2011. All Rights Reserved.