return unmarshalDomSource((DOMSource) source); else if (TraxUtils.isStaxSource(source)) { return unmarshalStaxSource(source);
public Object unmarshal(Source source, MimeContainer mimeContainer) throws XmlMappingException { try { Unmarshaller unmarshaller = createUnmarshaller(); if (mtomEnabled && mimeContainer != null) { unmarshaller.setAttachmentUnmarshaller(new Jaxb2AttachmentUnmarshaller(mimeContainer)); } if (TraxUtils.isStaxSource(source)) { return unmarshalStaxSource(unmarshaller, source); } else { return unmarshaller.unmarshal(source); } } catch (JAXBException ex) { throw convertJaxbException(ex); } }
public Object unmarshal(Source source) { if (TraxUtils.isStaxSource(source)) { XMLStreamReader streamReader = TraxUtils.getXMLStreamReader(source); if (streamReader != null) { source = new StaxSource(streamReader); } else { XMLEventReader eventReader = TraxUtils.getXMLEventReader(source); if (eventReader != null) { source = new StaxSource(eventReader); } else { throw new IllegalArgumentException( "StAXSource contains neither XMLStreamReader nor XMLEventReader"); } } } try { return createUnmarshaller().unmarshal(source); } catch (JAXBException ex) { throw convertJaxbException(ex); } }