Class XmlBinding


  • public class XmlBinding
    extends java.lang.Object
    Represents an XML mapping - performs XML (un)marshalling of objects/Full Data XML
    Author:
    Mark Woodbridge
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Model model  
    • Constructor Summary

      Constructors 
      Constructor Description
      XmlBinding​(Model model)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void marshal​(java.util.Collection<FastPathObject> col, java.io.Writer writer)
      Marshal a collection of objects to an XML file.
      java.util.List<FastPathObject> unmarshal​(java.io.InputStream is)
      Unmarshal an XML file to an object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • model

        protected Model model
    • Constructor Detail

      • XmlBinding

        public XmlBinding​(Model model)
        Constructor
        Parameters:
        model - an object model
    • Method Detail

      • marshal

        public void marshal​(java.util.Collection<FastPathObject> col,
                            java.io.Writer writer)
                     throws java.io.IOException
        Marshal a collection of objects to an XML file.
        Parameters:
        col - business objects to marshal into XML
        writer - the Writer to use
        Throws:
        java.io.IOException - if error encountered with writer
      • unmarshal

        public java.util.List<FastPathObject> unmarshal​(java.io.InputStream is)
                                                 throws InterMineException
        Unmarshal an XML file to an object.
        Parameters:
        is - the InputStream to read from
        Returns:
        a collection of business objects
        Throws:
        InterMineException - if an error occurs during unmarshalling