Beispiel #1
0
 /**
  * Unmarshal an XML file to an object.
  *
  * @param is the InputStream to read from
  * @return a collection of business objects
  * @throws InterMineException if an error occurs during unmarshalling
  */
 public List<FastPathObject> unmarshal(InputStream is) throws InterMineException {
   try {
     return FullParser.realiseObjects(FullParser.parse(is), model, false);
   } catch (Exception e) {
     throw new InterMineException("Error during unmarshalling", e);
   }
 }
    @SuppressWarnings({"unchecked", "rawtypes"})
    protected List getPublications(ObjectStore os) {
      try {
        List<Item> items =
            FullParser.parse(
                getClass()
                    .getClassLoader()
                    .getResourceAsStream("EntrezPublicationsRetrieverTest_src.xml"));

        return FullParser.realiseObjects(items, Model.getInstanceByName("genomic"), false);
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }