From 29860590af094c4a91ada75ff4d79a45979d9f50 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 18 Feb 2010 12:05:58 +0000 Subject: [PATCH] suppress unresolved xmlId warnings for initial unmarshalling of vamsas document git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@509 be28352e-c001-0410-b1a7-c7978e42abec --- src/uk/ac/vamsas/client/VorbaXmlBinder.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/uk/ac/vamsas/client/VorbaXmlBinder.java b/src/uk/ac/vamsas/client/VorbaXmlBinder.java index b237dcf..016700a 100644 --- a/src/uk/ac/vamsas/client/VorbaXmlBinder.java +++ b/src/uk/ac/vamsas/client/VorbaXmlBinder.java @@ -262,13 +262,16 @@ public class VorbaXmlBinder implements UnmarshalListener { public static Object[] getVamsasObjects(Reader instream, VorbaIdFactory factory, Vobject root) { Unmarshaller unmarshaller = new Unmarshaller(root); + final VorbaIdFactory ourfactory = factory; unmarshaller.setIDResolver(new IDResolver() { public Object resolve(String id) { - // TODO: allow for external ID resolution - VorbaXmlBinder.log - .warn("Warning - id " - + id - + " is not found in the Vamsas XML! (TODO: Ignore if this is a forward reference!)"); + if (ourfactory.warnUnresolved) { + // TODO: allow for external ID resolution + VorbaXmlBinder.log + .warn("Warning - id " + + id + + " is not found in the Vamsas XML! (TODO: Ignore if this is a forward reference!)"); + } return null; } }); @@ -287,7 +290,9 @@ public class VorbaXmlBinder implements UnmarshalListener { // TODO: mark objects in oobjhash prior to unmarshalling, to detect when // objects have been lost through an update. // tohere + factory.warnUnresolved = false; Object obj = unmarshaller.unmarshal(instream); + factory.warnUnresolved = true; boolean sync = ensure_references(unrefedObj, objrefs); if (!(obj instanceof Vobject)) return null; -- 1.7.10.2