/** * Same as {@link #unmarshal(XMLStreamReader, FilterVersion)}, but delegating to the unmarshaller * methods returning a JAXB element instead than the one returning the object. */ private <T> JAXBElement<T> unmarshal(XMLStreamReader input, final FilterVersion version, final Class<T> declaredType) throws XMLStreamException, JAXBException { input = new FilteredStreamReader(input, version); final Context context = begin(); final JAXBElement<T> object; try { object = unmarshaller.unmarshal(input, declaredType); } finally { context.finish(); } input.close(); // Despite its name, this method does not close the underlying input stream. return object; }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public Object unmarshal(XMLEventReader input) throws JAXBException { final TransformVersion version = getTransformVersion(); if (version != null) { input = new TransformingReader(input, version); } final Context context = begin(); try { return unmarshaller.unmarshal(input); } finally { context.finish(); } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public Object unmarshal(XMLStreamReader input) throws JAXBException { final FilterVersion version = getFilterVersion(); if (version != null) { input = new FilteredStreamReader(input, version); } final Context context = begin(); try { return unmarshaller.unmarshal(input); } finally { context.finish(); } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public <T> JAXBElement<T> unmarshal(XMLStreamReader input, final Class<T> declaredType) throws JAXBException { final FilterVersion version = getFilterVersion(); if (version != null) { input = new FilteredStreamReader(input, version); } final Context context = begin(); try { return unmarshaller.unmarshal(input, declaredType); } finally { context.finish(); } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public <T> JAXBElement<T> unmarshal(XMLEventReader input, final Class<T> declaredType) throws JAXBException { final TransformVersion version = getTransformVersion(); if (version != null) { input = new TransformingReader(input, version); } final Context context = begin(); try { return unmarshaller.unmarshal(input, declaredType); } finally { context.finish(); } }
/** * Same as {@link #unmarshal(XMLEventReader, TransformVersion)}, but delegating to the unmarshaller * methods returning a JAXB element instead than the one returning the object. */ private <T> JAXBElement<T> unmarshal(XMLEventReader input, final TransformVersion version, final Class<T> declaredType) throws XMLStreamException, JAXBException { input = new TransformingReader(input, version); final Context context = begin(); final JAXBElement<T> object; try { object = unmarshaller.unmarshal(input, declaredType); } finally { context.finish(); } input.close(); // Despite its name, this method does not close the underlying input stream. return object; }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public Object unmarshal(final File input) throws JAXBException { final TransformVersion version = getTransformVersion(); if (version != null) try { try (InputStream s = new BufferedInputStream(new FileInputStream(input))) { return unmarshal(InputFactory.createXMLEventReader(s), version); } } catch (IOException | XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public <T> JAXBElement<T> unmarshal(final Node input, final Class<T> declaredType) throws JAXBException { final FilterVersion version = getFilterVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLStreamReader(input), version, declaredType); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input, declaredType); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public Object unmarshal(final XMLEventReader input) throws JAXBException { final FilterVersion version = getFilterVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLStreamReader(input), version); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public Object unmarshal(final XMLStreamReader input) throws JAXBException { final TransformVersion version = getTransformVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLEventReader(input), version); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public Object unmarshal(final Reader input) throws JAXBException { final TransformVersion version = getTransformVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLEventReader(input), version); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public <T> JAXBElement<T> unmarshal(final Source input, final Class<T> declaredType) throws JAXBException { final TransformVersion version = getTransformVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLEventReader(input), version, declaredType); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input, declaredType); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public Object unmarshal(final InputStream input) throws JAXBException { final FilterVersion version = getFilterVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLStreamReader(input), version); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public Object unmarshal(final Source input) throws JAXBException { final FilterVersion version = getFilterVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLStreamReader(input), version); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public Object unmarshal(final Reader input) throws JAXBException { final FilterVersion version = getFilterVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLStreamReader(input), version); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public Object unmarshal(final InputSource input) throws JAXBException { final FilterVersion version = getFilterVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLStreamReader(input), version); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public <T> JAXBElement<T> unmarshal(final Source input, final Class<T> declaredType) throws JAXBException { final FilterVersion version = getFilterVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLStreamReader(input), version, declaredType); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input, declaredType); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public <T> JAXBElement<T> unmarshal(final XMLEventReader input, final Class<T> declaredType) throws JAXBException { final FilterVersion version = getFilterVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLStreamReader(input), version, declaredType); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input, declaredType); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public Object unmarshal(final Node input) throws JAXBException { final TransformVersion version = getTransformVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLEventReader(input), version); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input); } finally { context.finish(); } } }
/** * Delegates the unmarshalling to the wrapped unmarshaller. */ @Override public Object unmarshal(final Node input) throws JAXBException { final FilterVersion version = getFilterVersion(); if (version != null) try { return unmarshal(InputFactory.createXMLStreamReader(input), version); } catch (XMLStreamException e) { throw new JAXBException(e); } else { final Context context = begin(); try { return unmarshaller.unmarshal(input); } finally { context.finish(); } } }