Class FullParser


  • public final class FullParser
    extends java.lang.Object
    Unmarshal XML Full format data into java business objects.
    Author:
    Andrew Varley, Richard Smith
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<Item> parse​(java.io.InputStream is)
      Parse a InterMine Full XML file
      protected static FastPathObject populateObject​(Item item, java.util.Map<java.lang.String,​FastPathObject> objMap, boolean useIdentifier, boolean abortOnError, FastPathObject obj)
      Fill in fields of an outline business object which is in the map under item.identifier Note that this modifies the relevant object in the map It also returns the object for convenience
      static java.util.List<FastPathObject> realiseObjects​(java.util.Collection<Item> items, Model model, boolean useIdentifier)
      Create business objects from a collection of Items.
      static java.util.List<FastPathObject> realiseObjects​(java.util.Collection<Item> items, Model model, boolean useIdentifier, boolean abortOnError)
      Create business objects from a collection of Items.
      • Methods inherited from class java.lang.Object

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

      • parse

        public static java.util.List<Item> parse​(java.io.InputStream is)
                                          throws java.lang.Exception
        Parse a InterMine Full XML file
        Parameters:
        is - the InputStream to parse
        Returns:
        a list of Items
        Throws:
        java.lang.Exception - if there is an error while parsing
      • realiseObjects

        public static java.util.List<FastPathObject> realiseObjects​(java.util.Collection<Item> items,
                                                                    Model model,
                                                                    boolean useIdentifier)
                                                             throws java.lang.ClassNotFoundException
        Create business objects from a collection of Items. If there are any problems, throw an exception
        Parameters:
        items - a collection of items to realise
        model - the parent model
        useIdentifier - if true, set the id of each new object using the identifier of the Item problem and continue if possible
        Returns:
        a collection of realised business objects
        Throws:
        java.lang.ClassNotFoundException - if one of the items has a class that isn't in the model
      • realiseObjects

        public static java.util.List<FastPathObject> realiseObjects​(java.util.Collection<Item> items,
                                                                    Model model,
                                                                    boolean useIdentifier,
                                                                    boolean abortOnError)
                                                             throws java.lang.ClassNotFoundException
        Create business objects from a collection of Items.
        Parameters:
        items - a collection of items to realise
        model - the parent model
        useIdentifier - if true, set the id of each new object using the identifier of the Item
        abortOnError - if true, throw an exception if there is a problem. If false, log the problem and continue if possible
        Returns:
        a collection of realised business objects
        Throws:
        java.lang.ClassNotFoundException - if one of the items has a class that isn't in the model
      • populateObject

        protected static FastPathObject populateObject​(Item item,
                                                       java.util.Map<java.lang.String,​FastPathObject> objMap,
                                                       boolean useIdentifier,
                                                       boolean abortOnError,
                                                       FastPathObject obj)
        Fill in fields of an outline business object which is in the map under item.identifier Note that this modifies the relevant object in the map It also returns the object for convenience
        Parameters:
        item - a the Item to read field data from
        objMap - a map of item identifiers to outline business objects
        useIdentifier - if true, set the id of the new object using the identifier of the Item
        abortOnError - if true, throw an exception if there is a problem. If false, log the problem and continue if possible
        obj - the object
        Returns:
        a populated object