Java Code Examples for org.springframework.oxm.UnmarshallingFailureException

The following examples show how to use org.springframework.oxm.UnmarshallingFailureException. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Test
public void readWithMarshallingFailureException() throws Exception {
	MockHttpInputMessage inputMessage = new MockHttpInputMessage(new byte[0]);
	UnmarshallingFailureException ex = new UnmarshallingFailureException("forced");

	Unmarshaller unmarshaller = mock(Unmarshaller.class);
	given(unmarshaller.unmarshal(isA(StreamSource.class))).willThrow(ex);

	MarshallingHttpMessageConverter converter = new MarshallingHttpMessageConverter();
	converter.setUnmarshaller(unmarshaller);

	try {
		converter.read(Object.class, inputMessage);
		fail("HttpMessageNotReadableException should be thrown");
	}
	catch (HttpMessageNotReadableException e) {
		assertTrue("Invalid exception hierarchy", e.getCause() == ex);
	}
}
 
Example 2
Source Project: spring-analysis-note   Source File: AbstractMarshaller.java    License: MIT License 6 votes vote down vote up
/**
 * Build a new {@link Document} from this marshaller's {@link DocumentBuilderFactory},
 * as a placeholder for a DOM node.
 * @see #createDocumentBuilderFactory()
 * @see #createDocumentBuilder(DocumentBuilderFactory)
 */
protected Document buildDocument() {
	try {
		DocumentBuilder documentBuilder;
		synchronized (this.documentBuilderFactoryMonitor) {
			if (this.documentBuilderFactory == null) {
				this.documentBuilderFactory = createDocumentBuilderFactory();
			}
			documentBuilder = createDocumentBuilder(this.documentBuilderFactory);
		}
		return documentBuilder.newDocument();
	}
	catch (ParserConfigurationException ex) {
		throw new UnmarshallingFailureException("Could not create document placeholder: " + ex.getMessage(), ex);
	}
}
 
Example 3
Source Project: spring-analysis-note   Source File: AbstractMarshaller.java    License: MIT License 6 votes vote down vote up
/**
 * Template method for handling {@code DOMSource}s.
 * <p>This implementation delegates to {@code unmarshalDomNode}.
 * If the given source is empty, an empty source {@code Document}
 * will be created as a placeholder.
 * @param domSource the {@code DOMSource}
 * @return the object graph
 * @throws XmlMappingException if the given source cannot be mapped to an object
 * @throws IllegalArgumentException if the {@code domSource} is empty
 * @see #unmarshalDomNode(org.w3c.dom.Node)
 */
protected Object unmarshalDomSource(DOMSource domSource) throws XmlMappingException {
	if (domSource.getNode() == null) {
		domSource.setNode(buildDocument());
	}
	try {
		return unmarshalDomNode(domSource.getNode());
	}
	catch (NullPointerException ex) {
		if (!isSupportDtd()) {
			throw new UnmarshallingFailureException("NPE while unmarshalling. " +
					"This can happen on JDK 1.6 due to the presence of DTD " +
					"declarations, which are disabled.", ex);
		}
		throw ex;
	}
}
 
Example 4
Source Project: spring-analysis-note   Source File: Jaxb2Marshaller.java    License: MIT License 6 votes vote down vote up
/**
 * Convert the given {@code JAXBException} to an appropriate exception
 * from the {@code org.springframework.oxm} hierarchy.
 * @param ex {@code JAXBException} that occurred
 * @return the corresponding {@code XmlMappingException}
 */
protected XmlMappingException convertJaxbException(JAXBException ex) {
	if (ex instanceof ValidationException) {
		return new ValidationFailureException("JAXB validation exception", ex);
	}
	else if (ex instanceof MarshalException) {
		return new MarshallingFailureException("JAXB marshalling exception", ex);
	}
	else if (ex instanceof UnmarshalException) {
		return new UnmarshallingFailureException("JAXB unmarshalling exception", ex);
	}
	else {
		// fallback
		return new UncategorizedMappingException("Unknown JAXB exception", ex);
	}
}
 
Example 5
Source Project: spring-analysis-note   Source File: XStreamMarshaller.java    License: MIT License 6 votes vote down vote up
/**
 * Convert the given XStream exception to an appropriate exception from the
 * {@code org.springframework.oxm} hierarchy.
 * <p>A boolean flag is used to indicate whether this exception occurs during marshalling or
 * unmarshalling, since XStream itself does not make this distinction in its exception hierarchy.
 * @param ex the XStream exception that occurred
 * @param marshalling indicates whether the exception occurs during marshalling ({@code true}),
 * or unmarshalling ({@code false})
 * @return the corresponding {@code XmlMappingException}
 */
protected XmlMappingException convertXStreamException(Exception ex, boolean marshalling) {
	if (ex instanceof StreamException || ex instanceof CannotResolveClassException ||
			ex instanceof ConversionException) {
		if (marshalling) {
			return new MarshallingFailureException("XStream marshalling exception",  ex);
		}
		else {
			return new UnmarshallingFailureException("XStream unmarshalling exception", ex);
		}
	}
	else {
		// fallback
		return new UncategorizedMappingException("Unknown XStream exception", ex);
	}
}
 
Example 6
@Test
public void readWithMarshallingFailureException() throws Exception {
	MockHttpInputMessage inputMessage = new MockHttpInputMessage(new byte[0]);
	UnmarshallingFailureException ex = new UnmarshallingFailureException("forced");

	Unmarshaller unmarshaller = mock(Unmarshaller.class);
	given(unmarshaller.unmarshal(isA(StreamSource.class))).willThrow(ex);

	MarshallingHttpMessageConverter converter = new MarshallingHttpMessageConverter();
	converter.setUnmarshaller(unmarshaller);

	try {
		converter.read(Object.class, inputMessage);
		fail("HttpMessageNotReadableException should be thrown");
	}
	catch (HttpMessageNotReadableException e) {
		assertTrue("Invalid exception hierarchy", e.getCause() == ex);
	}
}
 
Example 7
Source Project: java-technology-stack   Source File: AbstractMarshaller.java    License: MIT License 6 votes vote down vote up
/**
 * Build a new {@link Document} from this marshaller's {@link DocumentBuilderFactory},
 * as a placeholder for a DOM node.
 * @see #createDocumentBuilderFactory()
 * @see #createDocumentBuilder(DocumentBuilderFactory)
 */
protected Document buildDocument() {
	try {
		DocumentBuilder documentBuilder;
		synchronized (this.documentBuilderFactoryMonitor) {
			if (this.documentBuilderFactory == null) {
				this.documentBuilderFactory = createDocumentBuilderFactory();
			}
			documentBuilder = createDocumentBuilder(this.documentBuilderFactory);
		}
		return documentBuilder.newDocument();
	}
	catch (ParserConfigurationException ex) {
		throw new UnmarshallingFailureException("Could not create document placeholder: " + ex.getMessage(), ex);
	}
}
 
Example 8
Source Project: java-technology-stack   Source File: AbstractMarshaller.java    License: MIT License 6 votes vote down vote up
/**
 * Template method for handling {@code DOMSource}s.
 * <p>This implementation delegates to {@code unmarshalDomNode}.
 * If the given source is empty, an empty source {@code Document}
 * will be created as a placeholder.
 * @param domSource the {@code DOMSource}
 * @return the object graph
 * @throws XmlMappingException if the given source cannot be mapped to an object
 * @throws IllegalArgumentException if the {@code domSource} is empty
 * @see #unmarshalDomNode(org.w3c.dom.Node)
 */
protected Object unmarshalDomSource(DOMSource domSource) throws XmlMappingException {
	if (domSource.getNode() == null) {
		domSource.setNode(buildDocument());
	}
	try {
		return unmarshalDomNode(domSource.getNode());
	}
	catch (NullPointerException ex) {
		if (!isSupportDtd()) {
			throw new UnmarshallingFailureException("NPE while unmarshalling. " +
					"This can happen on JDK 1.6 due to the presence of DTD " +
					"declarations, which are disabled.", ex);
		}
		throw ex;
	}
}
 
Example 9
Source Project: java-technology-stack   Source File: Jaxb2Marshaller.java    License: MIT License 6 votes vote down vote up
/**
 * Convert the given {@code JAXBException} to an appropriate exception from the
 * {@code org.springframework.oxm} hierarchy.
 * @param ex {@code JAXBException} that occurred
 * @return the corresponding {@code XmlMappingException}
 */
protected XmlMappingException convertJaxbException(JAXBException ex) {
	if (ex instanceof ValidationException) {
		return new ValidationFailureException("JAXB validation exception", ex);
	}
	else if (ex instanceof MarshalException) {
		return new MarshallingFailureException("JAXB marshalling exception", ex);
	}
	else if (ex instanceof UnmarshalException) {
		return new UnmarshallingFailureException("JAXB unmarshalling exception", ex);
	}
	else {
		// fallback
		return new UncategorizedMappingException("Unknown JAXB exception", ex);
	}
}
 
Example 10
Source Project: java-technology-stack   Source File: CastorMarshaller.java    License: MIT License 6 votes vote down vote up
/**
 * Convert the given {@code XMLException} to an appropriate exception from the
 * {@code org.springframework.oxm} hierarchy.
 * <p>A boolean flag is used to indicate whether this exception occurs during marshalling or
 * unmarshalling, since Castor itself does not make this distinction in its exception hierarchy.
 * @param ex the Castor {@code XMLException} that occurred
 * @param marshalling indicates whether the exception occurs during marshalling ({@code true}),
 * or unmarshalling ({@code false})
 * @return the corresponding {@code XmlMappingException}
 */
protected XmlMappingException convertCastorException(XMLException ex, boolean marshalling) {
	if (ex instanceof ValidationException) {
		return new ValidationFailureException("Castor validation exception", ex);
	}
	else if (ex instanceof MarshalException) {
		if (marshalling) {
			return new MarshallingFailureException("Castor marshalling exception", ex);
		}
		else {
			return new UnmarshallingFailureException("Castor unmarshalling exception", ex);
		}
	}
	else {
		// fallback
		return new UncategorizedMappingException("Unknown Castor exception", ex);
	}
}
 
Example 11
Source Project: java-technology-stack   Source File: XStreamMarshaller.java    License: MIT License 6 votes vote down vote up
/**
 * Convert the given XStream exception to an appropriate exception from the
 * {@code org.springframework.oxm} hierarchy.
 * <p>A boolean flag is used to indicate whether this exception occurs during marshalling or
 * unmarshalling, since XStream itself does not make this distinction in its exception hierarchy.
 * @param ex the XStream exception that occurred
 * @param marshalling indicates whether the exception occurs during marshalling ({@code true}),
 * or unmarshalling ({@code false})
 * @return the corresponding {@code XmlMappingException}
 */
protected XmlMappingException convertXStreamException(Exception ex, boolean marshalling) {
	if (ex instanceof StreamException || ex instanceof CannotResolveClassException ||
			ex instanceof ConversionException) {
		if (marshalling) {
			return new MarshallingFailureException("XStream marshalling exception",  ex);
		}
		else {
			return new UnmarshallingFailureException("XStream unmarshalling exception", ex);
		}
	}
	else {
		// fallback
		return new UncategorizedMappingException("Unknown XStream exception", ex);
	}
}
 
Example 12
@Test
public void readWithMarshallingFailureException() throws Exception {
	MockHttpInputMessage inputMessage = new MockHttpInputMessage(new byte[0]);
	UnmarshallingFailureException ex = new UnmarshallingFailureException("forced");

	Unmarshaller unmarshaller = mock(Unmarshaller.class);
	given(unmarshaller.unmarshal(isA(StreamSource.class))).willThrow(ex);

	MarshallingHttpMessageConverter converter = new MarshallingHttpMessageConverter();
	converter.setUnmarshaller(unmarshaller);

	try {
		converter.read(Object.class, inputMessage);
		fail("HttpMessageNotReadableException should be thrown");
	}
	catch (HttpMessageNotReadableException e) {
		assertTrue("Invalid exception hierarchy", e.getCause() == ex);
	}
}
 
Example 13
Source Project: spring4-understanding   Source File: AbstractMarshaller.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Template method for handling {@code DOMSource}s.
 * <p>This implementation delegates to {@code unmarshalDomNode}.
 * If the given source is empty, an empty source {@code Document}
 * will be created as a placeholder.
 * @param domSource the {@code DOMSource}
 * @return the object graph
 * @throws XmlMappingException if the given source cannot be mapped to an object
 * @throws IllegalArgumentException if the {@code domSource} is empty
 * @see #unmarshalDomNode(org.w3c.dom.Node)
 */
protected Object unmarshalDomSource(DOMSource domSource) throws XmlMappingException {
	if (domSource.getNode() == null) {
		domSource.setNode(buildDocument());
	}
	try {
		return unmarshalDomNode(domSource.getNode());
	}
	catch (NullPointerException ex) {
		if (!isSupportDtd()) {
			throw new UnmarshallingFailureException("NPE while unmarshalling. " +
					"This can happen on JDK 1.6 due to the presence of DTD " +
					"declarations, which are disabled.", ex);
		}
		throw ex;
	}
}
 
Example 14
Source Project: spring4-understanding   Source File: Jaxb2Marshaller.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Convert the given {@code JAXBException} to an appropriate exception from the
 * {@code org.springframework.oxm} hierarchy.
 * @param ex {@code JAXBException} that occured
 * @return the corresponding {@code XmlMappingException}
 */
protected XmlMappingException convertJaxbException(JAXBException ex) {
	if (ex instanceof ValidationException) {
		return new ValidationFailureException("JAXB validation exception", ex);
	}
	else if (ex instanceof MarshalException) {
		return new MarshallingFailureException("JAXB marshalling exception", ex);
	}
	else if (ex instanceof UnmarshalException) {
		return new UnmarshallingFailureException("JAXB unmarshalling exception", ex);
	}
	else {
		// fallback
		return new UncategorizedMappingException("Unknown JAXB exception", ex);
	}
}
 
Example 15
Source Project: spring4-understanding   Source File: CastorMarshaller.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Convert the given {@code XMLException} to an appropriate exception from the
 * {@code org.springframework.oxm} hierarchy.
 * <p>A boolean flag is used to indicate whether this exception occurs during marshalling or
 * unmarshalling, since Castor itself does not make this distinction in its exception hierarchy.
 * @param ex Castor {@code XMLException} that occurred
 * @param marshalling indicates whether the exception occurs during marshalling ({@code true}),
 * or unmarshalling ({@code false})
 * @return the corresponding {@code XmlMappingException}
 */
protected XmlMappingException convertCastorException(XMLException ex, boolean marshalling) {
	if (ex instanceof ValidationException) {
		return new ValidationFailureException("Castor validation exception", ex);
	}
	else if (ex instanceof MarshalException) {
		if (marshalling) {
			return new MarshallingFailureException("Castor marshalling exception", ex);
		}
		else {
			return new UnmarshallingFailureException("Castor unmarshalling exception", ex);
		}
	}
	else {
		// fallback
		return new UncategorizedMappingException("Unknown Castor exception", ex);
	}
}
 
Example 16
Source Project: spring4-understanding   Source File: XStreamMarshaller.java    License: Apache License 2.0 6 votes vote down vote up
/**
    * Convert the given XStream exception to an appropriate exception from the
    * {@code org.springframework.oxm} hierarchy.
    * <p>A boolean flag is used to indicate whether this exception occurs during marshalling or
    * unmarshalling, since XStream itself does not make this distinction in its exception hierarchy.
    * @param ex XStream exception that occurred
    * @param marshalling indicates whether the exception occurs during marshalling ({@code true}),
    * or unmarshalling ({@code false})
    * @return the corresponding {@code XmlMappingException}
    */
protected XmlMappingException convertXStreamException(Exception ex, boolean marshalling) {
	if (ex instanceof StreamException || ex instanceof CannotResolveClassException ||
			ex instanceof ConversionException) {
		if (marshalling) {
			return new MarshallingFailureException("XStream marshalling exception",  ex);
		}
		else {
			return new UnmarshallingFailureException("XStream unmarshalling exception", ex);
		}
	}
	else {
		// fallback
		return new UncategorizedMappingException("Unknown XStream exception", ex);
	}
}
 
Example 17
Source Project: spring4-understanding   Source File: XmlBeansMarshaller.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Convert the given XMLBeans exception to an appropriate exception from the
 * {@code org.springframework.oxm} hierarchy.
 * <p>A boolean flag is used to indicate whether this exception occurs during marshalling or
 * unmarshalling, since XMLBeans itself does not make this distinction in its exception hierarchy.
 * @param ex XMLBeans Exception that occured
 * @param marshalling indicates whether the exception occurs during marshalling ({@code true}),
 * or unmarshalling ({@code false})
 * @return the corresponding {@code XmlMappingException}
 */
protected XmlMappingException convertXmlBeansException(Exception ex, boolean marshalling) {
	if (ex instanceof XMLStreamValidationException) {
		return new ValidationFailureException("XMLBeans validation exception", ex);
	}
	else if (ex instanceof XmlException || ex instanceof SAXException) {
		if (marshalling) {
			return new MarshallingFailureException("XMLBeans marshalling exception",  ex);
		}
		else {
			return new UnmarshallingFailureException("XMLBeans unmarshalling exception", ex);
		}
	}
	else {
		// fallback
		return new UncategorizedMappingException("Unknown XMLBeans exception", ex);
	}
}
 
Example 18
Source Project: spring-analysis-note   Source File: JibxMarshaller.java    License: MIT License 5 votes vote down vote up
@Override
protected Object unmarshalXmlEventReader(XMLEventReader eventReader) {
	try {
		XMLStreamReader streamReader = StaxUtils.createEventStreamReader(eventReader);
		return unmarshalXmlStreamReader(streamReader);
	}
	catch (XMLStreamException ex) {
		return new UnmarshallingFailureException("JiBX unmarshalling exception", ex);
	}
}
 
Example 19
Source Project: spring-analysis-note   Source File: JibxMarshaller.java    License: MIT License 5 votes vote down vote up
@Override
protected Object unmarshalDomNode(Node node) throws XmlMappingException {
	try {
		return transformAndUnmarshal(new DOMSource(node), null);
	}
	catch (IOException ex) {
		throw new UnmarshallingFailureException("JiBX unmarshalling exception", ex);
	}
}
 
Example 20
Source Project: spring-analysis-note   Source File: JibxMarshaller.java    License: MIT License 5 votes vote down vote up
/**
 * Convert the given {@code JiBXException} to an appropriate exception from the
 * {@code org.springframework.oxm} hierarchy.
 * <p>A boolean flag is used to indicate whether this exception occurs during marshalling or
 * unmarshalling, since JiBX itself does not make this distinction in its exception hierarchy.
 * @param ex {@code JiBXException} that occurred
 * @param marshalling indicates whether the exception occurs during marshalling ({@code true}),
 * or unmarshalling ({@code false})
 * @return the corresponding {@code XmlMappingException}
 */
public XmlMappingException convertJibxException(JiBXException ex, boolean marshalling) {
	if (ex instanceof ValidationException) {
		return new ValidationFailureException("JiBX validation exception", ex);
	}
	else {
		if (marshalling) {
			return new MarshallingFailureException("JiBX marshalling exception", ex);
		}
		else {
			return new UnmarshallingFailureException("JiBX unmarshalling exception", ex);
		}
	}
}
 
Example 21
Source Project: spring-analysis-note   Source File: Jaxb2Marshaller.java    License: MIT License 5 votes vote down vote up
@Override
public byte[] getAttachmentAsByteArray(String cid) {
	try {
		DataHandler dataHandler = getAttachmentAsDataHandler(cid);
		return FileCopyUtils.copyToByteArray(dataHandler.getInputStream());
	}
	catch (IOException ex) {
		throw new UnmarshallingFailureException("Couldn't read attachment", ex);
	}
}
 
Example 22
Source Project: java-technology-stack   Source File: JibxMarshaller.java    License: MIT License 5 votes vote down vote up
@Override
protected Object unmarshalXmlEventReader(XMLEventReader eventReader) {
	try {
		XMLStreamReader streamReader = StaxUtils.createEventStreamReader(eventReader);
		return unmarshalXmlStreamReader(streamReader);
	}
	catch (XMLStreamException ex) {
		return new UnmarshallingFailureException("JiBX unmarshalling exception", ex);
	}
}
 
Example 23
Source Project: java-technology-stack   Source File: JibxMarshaller.java    License: MIT License 5 votes vote down vote up
@Override
protected Object unmarshalDomNode(Node node) throws XmlMappingException {
	try {
		return transformAndUnmarshal(new DOMSource(node), null);
	}
	catch (IOException ex) {
		throw new UnmarshallingFailureException("JiBX unmarshalling exception", ex);
	}
}
 
Example 24
Source Project: java-technology-stack   Source File: JibxMarshaller.java    License: MIT License 5 votes vote down vote up
/**
 * Convert the given {@code JiBXException} to an appropriate exception from the
 * {@code org.springframework.oxm} hierarchy.
 * <p>A boolean flag is used to indicate whether this exception occurs during marshalling or
 * unmarshalling, since JiBX itself does not make this distinction in its exception hierarchy.
 * @param ex {@code JiBXException} that occurred
 * @param marshalling indicates whether the exception occurs during marshalling ({@code true}),
 * or unmarshalling ({@code false})
 * @return the corresponding {@code XmlMappingException}
 */
public XmlMappingException convertJibxException(JiBXException ex, boolean marshalling) {
	if (ex instanceof ValidationException) {
		return new ValidationFailureException("JiBX validation exception", ex);
	}
	else {
		if (marshalling) {
			return new MarshallingFailureException("JiBX marshalling exception", ex);
		}
		else {
			return new UnmarshallingFailureException("JiBX unmarshalling exception", ex);
		}
	}
}
 
Example 25
Source Project: java-technology-stack   Source File: Jaxb2Marshaller.java    License: MIT License 5 votes vote down vote up
@Override
public byte[] getAttachmentAsByteArray(String cid) {
	try {
		DataHandler dataHandler = getAttachmentAsDataHandler(cid);
		return FileCopyUtils.copyToByteArray(dataHandler.getInputStream());
	}
	catch (IOException ex) {
		throw new UnmarshallingFailureException("Couldn't read attachment", ex);
	}
}
 
Example 26
Source Project: java-technology-stack   Source File: CastorMarshaller.java    License: MIT License 5 votes vote down vote up
@Override
protected Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
		throws XmlMappingException, IOException {

	UnmarshalHandler unmarshalHandler = createUnmarshaller().createHandler();
	try {
		ContentHandler contentHandler = Unmarshaller.getContentHandler(unmarshalHandler);
		xmlReader.setContentHandler(contentHandler);
		xmlReader.parse(inputSource);
		return unmarshalHandler.getObject();
	}
	catch (SAXException ex) {
		throw new UnmarshallingFailureException("SAX reader exception", ex);
	}
}
 
Example 27
@Override
protected Object readFromSource(Class<?> clazz, HttpHeaders headers, Source source) throws IOException {
	Assert.notNull(this.unmarshaller, "Property 'unmarshaller' is required");
	try {
		Object result = this.unmarshaller.unmarshal(source);
		if (!clazz.isInstance(result)) {
			throw new TypeMismatchException(result, clazz);
		}
		return result;
	}
	catch (UnmarshallingFailureException ex) {
		throw new HttpMessageNotReadableException("Could not read [" + clazz + "]", ex);
	}
}
 
Example 28
@Override
protected Object readFromSource(Class<?> clazz, HttpHeaders headers, Source source) throws IOException {
	Assert.notNull(this.unmarshaller, "Property 'unmarshaller' is required");
	try {
		Object result = this.unmarshaller.unmarshal(source);
		if (!clazz.isInstance(result)) {
			throw new TypeMismatchException(result, clazz);
		}
		return result;
	}
	catch (UnmarshallingFailureException ex) {
		throw new HttpMessageNotReadableException("Could not read [" + clazz + "]", ex);
	}
}
 
Example 29
Source Project: spring4-understanding   Source File: JibxMarshaller.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected Object unmarshalXmlEventReader(XMLEventReader eventReader) {
	try {
		XMLStreamReader streamReader = StaxUtils.createEventStreamReader(eventReader);
		return unmarshalXmlStreamReader(streamReader);
	}
	catch (XMLStreamException ex) {
		return new UnmarshallingFailureException("JiBX unmarshalling exception", ex);
	}
}
 
Example 30
Source Project: spring4-understanding   Source File: JibxMarshaller.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected Object unmarshalDomNode(Node node) throws XmlMappingException {
	try {
		return transformAndUnmarshal(new DOMSource(node), null);
	}
	catch (IOException ex) {
		throw new UnmarshallingFailureException("JiBX unmarshalling exception", ex);
	}
}