/** * Returns the unmarshaller that converts a tree data structure * from XML to Java objects, reusing any existing unmarshaller. * @return the unmarshaller for the JAXB context * @throws JAXBException if unmarshaller initialization fails */ public Unmarshaller getUnmarshaller() throws JAXBException { return getUnmarshaller(true); } /**
/** * Returns the unmarshaller that converts a tree data structure * from XML to Java objects, reusing any existing unmarshaller. * @return the unmarshaller for the JAXB context */ public Unmarshaller getUnmarshaller() throws JAXBException { return getUnmarshaller(true); } /**
@Override protected void receiveContent(InputStream content) { try { @SuppressWarnings("unchecked") C unmarshalled = (C) getUnmarshaller().unmarshal( new InputStreamReader(content, "UTF-8") ); this.content = unmarshalled; } catch (JAXBException e) { logger.error("Failed to unmarshall object read from database document",e); throw new MarkLogicIOException(e); } catch (UnsupportedEncodingException e) { logger.error("Failed to unmarshall object read from database document",e); throw new MarkLogicIOException(e); } } @Override
@Override protected void receiveContent(InputStream content) { try { @SuppressWarnings("unchecked") C unmarshalled = (C) getUnmarshaller().unmarshal( new InputStreamReader(content, "UTF-8") ); this.content = unmarshalled; } catch (JAXBException e) { logger.error("Failed to unmarshall object read from database document",e); throw new MarkLogicIOException(e); } catch (UnsupportedEncodingException e) { logger.error("Failed to unmarshall object read from database document",e); throw new MarkLogicIOException(e); } finally { try { content.close(); } catch (IOException e) { // ignore. } } } @Override