public <T> T readAsJAXB(Unmarshaller unmarshaller) throws JAXBException { try { JAXBResult r = new JAXBResult(unmarshaller); // bridge marshals a fragment, so we need to add start/endDocument by ourselves r.getHandler().startDocument(); bridge.marshal(jaxbObject,r); r.getHandler().endDocument(); return (T)r.getResult(); } catch (SAXException e) { throw new JAXBException(e); } } /** @deprecated */
public <T> T readAsJAXB(Unmarshaller unmarshaller) throws JAXBException { try { JAXBResult r = new JAXBResult(unmarshaller); // bridge marshals a fragment, so we need to add start/endDocument by ourselves r.getHandler().startDocument(); bridge.marshal(jaxbObject,r); r.getHandler().endDocument(); return (T)r.getResult(); } catch (SAXException e) { throw new JAXBException(e); } } /** @deprecated */
public <T> T readAsJAXB(Unmarshaller unmarshaller) throws JAXBException { try { JAXBResult r = new JAXBResult(unmarshaller); // bridge marshals a fragment, so we need to add start/endDocument by ourselves r.getHandler().startDocument(); bridge.marshal(jaxbObject,r); r.getHandler().endDocument(); return (T)r.getResult(); } catch (SAXException e) { throw new JAXBException(e); } } /** @deprecated */
@Override public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException { JAXBResult out = new JAXBResult(unmarshaller); // since the bridge only produces fragments, we need to fire start/end document. try { out.getHandler().startDocument(); if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.TRUE); m.marshal(jaxbObject,out); } else bridge.marshal(jaxbObject,out); out.getHandler().endDocument(); } catch (SAXException e) { throw new JAXBException(e); } return (T)out.getResult(); }
@Override public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException { JAXBResult out = new JAXBResult(unmarshaller); // since the bridge only produces fragments, we need to fire start/end document. try { out.getHandler().startDocument(); if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.TRUE); m.marshal(jaxbObject,out); } else bridge.marshal(jaxbObject,out); out.getHandler().endDocument(); } catch (SAXException e) { throw new JAXBException(e); } return (T)out.getResult(); }
@Override public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException { JAXBResult out = new JAXBResult(unmarshaller); // since the bridge only produces fragments, we need to fire start/end document. try { out.getHandler().startDocument(); if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.TRUE); m.marshal(jaxbObject,out); } else bridge.marshal(jaxbObject,out); out.getHandler().endDocument(); } catch (SAXException e) { throw new JAXBException(e); } return (T)out.getResult(); }