[MOBY-guts] biomoby commit

Dmitry Repchevski drepchevski at dev.open-bio.org
Thu Feb 24 13:35:40 UTC 2011


drepchevski
Thu Feb 24 08:35:40 EST 2011
Update of /home/repository/moby/moby-live/Java/src/main/org/inb/biomoby/central/cache
In directory dev.open-bio.org:/tmp/cvs-serv310

Modified Files:
	CacheConfig.java 
Log Message:
Added a posibility to save a cache without XML Document event generation.
moby-live/Java/src/main/org/inb/biomoby/central/cache CacheConfig.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/inb/biomoby/central/cache/CacheConfig.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/org/inb/biomoby/central/cache/CacheConfig.java	2009/12/16 15:24:36	1.1
+++ /home/repository/moby/moby-live/Java/src/main/org/inb/biomoby/central/cache/CacheConfig.java	2011/02/24 13:35:39	1.2
@@ -151,15 +151,21 @@
         }
     }
 
+    public <T extends AbstractEntity> void save(List<T> entities, Writer writer) throws Exception
+    {
+        save(entities, writer, true);
+    }
+
     /**
      * Generic method to save BioMoby entities to the provided writer
      *
      * @param <T> - the entity type to save
      * @param entities - the list of entities to be saved
      * @param writer - the writer where entities are saved
+     * @param isFragment - whether or not document level events will be generated
      * @throws Exception
      */
-    public <T extends AbstractEntity> void save(List<T> entities, Writer writer) throws Exception
+    public <T extends AbstractEntity> void save(List<T> entities, Writer writer, boolean isFragment) throws Exception
     {
         CacheListWrapper wrapper = new CacheListWrapper(entities);
 
@@ -171,6 +177,7 @@
         Marshaller m = jc.createMarshaller();
 
         m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+        m.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.valueOf(isFragment));
 
         BufferedWriter out = new BufferedWriter(writer);
 




More information about the MOBY-guts mailing list