public void marshal(Object object, File file) throws JAXBException { try { FileOutputStream outputStream = new FileOutputStream(file); try { marshal(object, outputStream); // link to the other one } finally { outputStream.close(); } } catch (BeanValidationException bve) { throw new MarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } catch (Exception ex) { throw new MarshalException(ex); } }
@Override public void marshal(Object object, File file) throws JAXBException { try { FileOutputStream outputStream = new FileOutputStream(file); try { marshal(object, outputStream); // link to the other one } finally { outputStream.close(); } } catch (BeanValidationException bve) { throw new MarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } catch (Exception ex) { throw new MarshalException(ex); } }
public void marshal(Object object, Result result) throws JAXBException { if (object == null || result == null) { throw new IllegalArgumentException(); } object = validateAndTransformIfNeeded(object); // xml bindings + json object try { xmlMarshaller.marshal(object, result); } catch (BeanValidationException bve) { throw new MarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } catch (Exception e) { throw new MarshalException(e); } }
@Override public void marshal(Object object, Result result) throws JAXBException { if (object == null || result == null) { throw new IllegalArgumentException(); } object = validateAndTransformIfNeeded(object); // xml bindings + json object try { xmlMarshaller.marshal(object, result); } catch (BeanValidationException bve) { throw new MarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } catch (Exception e) { throw new MarshalException(e); } }
@Override public Object unmarshal(Node node) throws JAXBException { try { Object value = xmlUnmarshaller.unmarshal(node); return validateAndTransformIfRequired(value); // xml bindings + object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
public Object unmarshal(File file) throws JAXBException { try { Object value = xmlUnmarshaller.unmarshal(file); return validateAndTransformIfRequired(value); // xml object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
public Object unmarshal(InputSource inputSource) throws JAXBException { try { Object value = xmlUnmarshaller.unmarshal(inputSource); return validateAndTransformIfRequired(value); // xml bindings + object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
@Override public Object unmarshal(File file) throws JAXBException { try { Object value = xmlUnmarshaller.unmarshal(file); return validateAndTransformIfRequired(value); // xml object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
@Override public Object unmarshal(Source source) throws JAXBException { try { Object value = xmlUnmarshaller.unmarshal(source); return validateAndTransformIfRequired(value); // xml bindings + object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
public Object unmarshal(URL url) throws JAXBException { try { Object value = xmlUnmarshaller.unmarshal(url); return validateAndTransformIfRequired(value); // xml bindings + object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
public Object unmarshal(Node node) throws JAXBException { try { Object value = xmlUnmarshaller.unmarshal(node); return validateAndTransformIfRequired(value); // xml bindings + object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
public Object unmarshal(Source source) throws JAXBException { try { Object value = xmlUnmarshaller.unmarshal(source); return validateAndTransformIfRequired(value); // xml bindings + object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
@Override public Object unmarshal(URL url) throws JAXBException { try { Object value = xmlUnmarshaller.unmarshal(url); return validateAndTransformIfRequired(value); // xml bindings + object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
@Override public Object unmarshal(InputSource inputSource) throws JAXBException { try { Object value = xmlUnmarshaller.unmarshal(inputSource); return validateAndTransformIfRequired(value); // xml bindings + object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
public void marshal(Object object, MarshalRecord record) throws JAXBException { if (object == null || record == null) { throw new IllegalArgumentException(); } object = validateAndTransformIfNeeded(object); // xml bindings + object try { record.setMarshaller(xmlMarshaller); xmlMarshaller.marshal(object, record); } catch (BeanValidationException bve) { throw new MarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } catch (Exception e) { throw new MarshalException(e); } }
public void marshal(Object object, MarshalRecord record) throws JAXBException { if (object == null || record == null) { throw new IllegalArgumentException(); } object = validateAndTransformIfNeeded(object); // xml bindings + object try { record.setMarshaller(xmlMarshaller); xmlMarshaller.marshal(object, record); } catch (BeanValidationException bve) { throw new MarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } catch (Exception e) { throw new MarshalException(e); } }
public Object unmarshal(XMLStreamReader streamReader) throws JAXBException { if(null == streamReader) { throw new IllegalArgumentException(); } try { XMLStreamReaderReader staxReader = new XMLStreamReaderReader(xmlUnmarshaller); XMLStreamReaderInputSource inputSource = new XMLStreamReaderInputSource(streamReader); Object value = xmlUnmarshaller.unmarshal(staxReader, inputSource); return validateAndTransformIfRequired(value); // xml bindings + object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
@Override public Object unmarshal(XMLEventReader eventReader) throws JAXBException { if(null == eventReader) { throw new IllegalArgumentException(); } try { XMLEventReaderReader staxReader = new XMLEventReaderReader(xmlUnmarshaller); XMLEventReaderInputSource inputSource = new XMLEventReaderInputSource(eventReader); Object value = xmlUnmarshaller.unmarshal(staxReader, inputSource); return validateAndTransformIfRequired(value); // xml bindings + object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
@Override public Object unmarshal(XMLStreamReader streamReader) throws JAXBException { if(null == streamReader) { throw new IllegalArgumentException(); } try { XMLStreamReaderReader staxReader = new XMLStreamReaderReader(xmlUnmarshaller); XMLStreamReaderInputSource inputSource = new XMLStreamReaderInputSource(streamReader); Object value = xmlUnmarshaller.unmarshal(staxReader, inputSource); return validateAndTransformIfRequired(value); // xml bindings + object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }
public Object unmarshal(XMLEventReader eventReader) throws JAXBException { if(null == eventReader) { throw new IllegalArgumentException(); } try { XMLEventReaderReader staxReader = new XMLEventReaderReader(xmlUnmarshaller); XMLEventReaderInputSource inputSource = new XMLEventReaderInputSource(eventReader); Object value = xmlUnmarshaller.unmarshal(staxReader, inputSource); return validateAndTransformIfRequired(value); // xml bindings + object } catch (XMLMarshalException xmlMarshalException) { throw handleXMLMarshalException(xmlMarshalException); } catch (BeanValidationException bve) { throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve); } }