import jalview.xml.binding.embl.EntryType;
import jalview.xml.binding.embl.EntryType.Feature;
import jalview.xml.binding.embl.EntryType.Feature.Qualifier;
+import jalview.xml.binding.jalview.JalviewModel;
+import jalview.xml.binding.embl.ROOT;
import jalview.xml.binding.embl.XrefType;
import java.io.File;
import java.util.regex.Pattern;
import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLInputFactory;
XMLStreamReader streamReader = XMLInputFactory.newInstance()
.createXMLStreamReader(is);
javax.xml.bind.Unmarshaller um = jc.createUnmarshaller();
- jalview.xml.binding.embl.ROOT root = (jalview.xml.binding.embl.ROOT) um
- .unmarshal(streamReader);
+ JAXBElement<ROOT> rootElement = um.unmarshal(streamReader, ROOT.class);
+ ROOT root = rootElement.getValue();
/*
* document root contains either "entry" or "entrySet"
import jalview.schemes.ResidueProperties;
import jalview.util.StringUtils;
import jalview.ws.seqfetcher.DbSourceProxyImpl;
+import jalview.xml.binding.embl.ROOT;
import jalview.xml.binding.uniprot.DbReferenceType;
import jalview.xml.binding.uniprot.Entry;
import jalview.xml.binding.uniprot.FeatureType;
import java.util.Vector;
import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLInputFactory;
XMLStreamReader streamReader = XMLInputFactory.newInstance()
.createXMLStreamReader(is);
javax.xml.bind.Unmarshaller um = jc.createUnmarshaller();
- jalview.xml.binding.uniprot.Uniprot uniprot = (jalview.xml.binding.uniprot.Uniprot) um.unmarshal(streamReader);
+ JAXBElement<jalview.xml.binding.uniprot.Uniprot> uniprotElement =
+ um.unmarshal(streamReader, jalview.xml.binding.uniprot.Uniprot.class);
+ jalview.xml.binding.uniprot.Uniprot uniprot = uniprotElement.getValue();
+
if (uniprot != null && !uniprot.getEntry().isEmpty())
{
entries = uniprot.getEntry();