protected StrBuffer getStringBuffer() { return unmarshaller.getStringBuffer(); }
public CharSequence getCharacters() { return unmarshaller.getStringBuffer(); }
protected StrBuffer getStringBuffer() { return unmarshaller.getStringBuffer(); }
public CharSequence getCharacters() { return unmarshaller.getStringBuffer(); }
public Object unmarshal(URL url, Class clazz) { InputStream inputStream = null; try { inputStream = url.openStream(); }catch (IOException e) { throw XMLMarshalException.unmarshalException(e); } this.systemId = url.toExternalForm(); try { return unmarshal(inputStream, clazz); } finally { xmlUnmarshaller.getStringBuffer().reset(); try{ inputStream.close(); }catch (IOException e) { throw XMLMarshalException.unmarshalException(e); } } }
@Override public Object unmarshal(URL url, Class clazz) { InputStream inputStream = null; try { inputStream = url.openStream(); } catch (IOException e) { throw XMLMarshalException.unmarshalException(e); } this.systemId = url.toExternalForm(); try { return unmarshal(inputStream, clazz); } finally { xmlUnmarshaller.getStringBuffer().reset(); try { inputStream.close(); } catch (IOException e) { throw XMLMarshalException.unmarshalException(e); } } }
public Object unmarshal(URL url) { InputStream inputStream = null; try { inputStream = url.openStream(); } catch (Exception e) { throw XMLMarshalException.unmarshalException(e); } this.systemId = url.toExternalForm(); boolean hasThrownException = false; try { return unmarshal(inputStream); } catch (RuntimeException runtimeException) { hasThrownException = true; throw runtimeException; } finally { xmlUnmarshaller.getStringBuffer().reset(); try { inputStream.close(); } catch (IOException e) { if (!hasThrownException) { throw XMLMarshalException.unmarshalException(e); } } } }
@Override public Object unmarshal(URL url) { InputStream inputStream = null; try { inputStream = url.openStream(); } catch (Exception e) { throw XMLMarshalException.unmarshalException(e); } this.systemId = url.toExternalForm(); boolean hasThrownException = false; try { return unmarshal(inputStream); } catch (RuntimeException runtimeException) { hasThrownException = true; throw runtimeException; } finally { xmlUnmarshaller.getStringBuffer().reset(); try { inputStream.close(); } catch (IOException e) { if (!hasThrownException) { throw XMLMarshalException.unmarshalException(e); } } } }
@Override public Object unmarshal(File file, Class clazz) { try { if (xmlUnmarshaller.getContext().hasDocumentPreservation()) { Node domElement = getXMLParser().parse(file).getDocumentElement(); return unmarshal(domElement, clazz); } this.systemId = file.toURI().toURL().toExternalForm(); FileInputStream inputStream = new FileInputStream(file); try { return unmarshal(inputStream, clazz); } finally { inputStream.close(); } } catch (FileNotFoundException e) { throw XMLMarshalException.unmarshalException(e); } catch (IOException e) { throw XMLMarshalException.unmarshalException(e); } finally { xmlUnmarshaller.getStringBuffer().reset(); } }
public Object unmarshal(File file, Class clazz) { try { if (xmlUnmarshaller.getContext().hasDocumentPreservation()) { Node domElement = getXMLParser().parse(file).getDocumentElement(); return unmarshal(domElement, clazz); } this.systemId = file.toURI().toURL().toExternalForm(); FileInputStream inputStream = new FileInputStream(file); try { return unmarshal(inputStream, clazz); } finally { inputStream.close(); } } catch (FileNotFoundException e) { throw XMLMarshalException.unmarshalException(e); } catch (IOException e) { throw XMLMarshalException.unmarshalException(e); } finally { xmlUnmarshaller.getStringBuffer().reset(); } }
public Object unmarshal(File file) { try { if (xmlUnmarshaller.getContext().hasDocumentPreservation()) { Node domElement = getXMLParser().parse(file).getDocumentElement(); return unmarshal(domElement); } this.systemId = file.toURI().toURL().toExternalForm(); FileInputStream inputStream = new FileInputStream(file); try { return unmarshal(inputStream); } finally { inputStream.close(); } } catch (FileNotFoundException e) { throw XMLMarshalException.unmarshalException(e); } catch (IOException e) { throw XMLMarshalException.unmarshalException(e); } finally { xmlUnmarshaller.getStringBuffer().reset(); } }
@Override public Object unmarshal(File file) { try { if (xmlUnmarshaller.getContext().hasDocumentPreservation()) { Node domElement = getXMLParser().parse(file).getDocumentElement(); return unmarshal(domElement); } this.systemId = file.toURI().toURL().toExternalForm(); FileInputStream inputStream = new FileInputStream(file); try { return unmarshal(inputStream); } finally { inputStream.close(); } } catch (FileNotFoundException e) { throw XMLMarshalException.unmarshalException(e); } catch (IOException e) { throw XMLMarshalException.unmarshalException(e); } finally { xmlUnmarshaller.getStringBuffer().reset(); } }
public Object unmarshal(InputSource inputSource, XMLReader xmlReader) { try { if (inputSource != null && null == inputSource.getSystemId()) { inputSource.setSystemId(this.systemId); } SAXUnmarshallerHandler saxUnmarshallerHandler = new SAXUnmarshallerHandler(xmlUnmarshaller.getContext()); saxUnmarshallerHandler.setXMLReader(xmlReader); saxUnmarshallerHandler.setUnmarshaller(xmlUnmarshaller); setContentHandler(xmlReader, saxUnmarshallerHandler); xmlReader.parse(inputSource); // resolve any mapping references saxUnmarshallerHandler.resolveReferences(); return saxUnmarshallerHandler.getObject(); } catch (IOException e) { throw XMLMarshalException.unmarshalException(e); } catch (SAXException e) { throw convertSAXException(e); } finally { xmlUnmarshaller.getStringBuffer().reset(); } }
public Object unmarshal(InputSource inputSource, XMLReader xmlReader) { try { if (inputSource != null && null == inputSource.getSystemId()) { inputSource.setSystemId(this.systemId); } SAXUnmarshallerHandler saxUnmarshallerHandler = new SAXUnmarshallerHandler(xmlUnmarshaller.getContext()); saxUnmarshallerHandler.setXMLReader(xmlReader); saxUnmarshallerHandler.setUnmarshaller(xmlUnmarshaller); setContentHandler(xmlReader, saxUnmarshallerHandler); xmlReader.parse(inputSource); // resolve any mapping references saxUnmarshallerHandler.resolveReferences(); return saxUnmarshallerHandler.getObject(); } catch (IOException e) { throw XMLMarshalException.unmarshalException(e); } catch (SAXException e) { throw convertSAXException(e); } finally { xmlUnmarshaller.getStringBuffer().reset(); } }
throw convertSAXException(e); } finally { xmlUnmarshaller.getStringBuffer().reset();
public Object unmarshal(DOMReader reader, Node node) { try { SAXUnmarshallerHandler handler = new SAXUnmarshallerHandler(xmlUnmarshaller.getContext()); setContentHandler(reader, handler); handler.setXMLReader(reader); handler.setUnmarshaller(xmlUnmarshaller); reader.parse(node); handler.resolveReferences(); return handler.getObject(); } catch (SAXException e) { throw convertSAXException(e); } finally { xmlUnmarshaller.getStringBuffer().reset(); } }
throw convertSAXException(e); } finally { xmlUnmarshaller.getStringBuffer().reset();
public Object unmarshal(DOMReader reader, Node node) { try { SAXUnmarshallerHandler handler = new SAXUnmarshallerHandler(xmlUnmarshaller.getContext()); setContentHandler(reader, handler); handler.setXMLReader(reader); handler.setUnmarshaller(xmlUnmarshaller); reader.parse(node); handler.resolveReferences(); return handler.getObject(); } catch (SAXException e) { throw convertSAXException(e); } finally { xmlUnmarshaller.getStringBuffer().reset(); } }
public Object unmarshal(String systemId) { try { if (xmlUnmarshaller.isAutoDetectMediaType()) { InputSource inputSource = new InputSource(systemId); return unmarshal(inputSource); } XMLReader xmlReader = getXMLReader(); SAXUnmarshallerHandler saxUnmarshallerHandler = new SAXUnmarshallerHandler(xmlUnmarshaller.getContext()); saxUnmarshallerHandler.setXMLReader(xmlReader); saxUnmarshallerHandler.setUnmarshaller(xmlUnmarshaller); setContentHandler(xmlReader, saxUnmarshallerHandler); xmlReader.parse(systemId); // resolve mapping references saxUnmarshallerHandler.resolveReferences(); return saxUnmarshallerHandler.getObject(); } catch (IOException e) { throw XMLMarshalException.unmarshalException(e); } catch (SAXException e) { throw convertSAXException(e); } finally { xmlUnmarshaller.getStringBuffer().reset(); } }
public Object unmarshal(String systemId) { try { if(xmlUnmarshaller.isAutoDetectMediaType()){ InputSource inputSource = new InputSource(systemId); return unmarshal(inputSource); } XMLReader xmlReader = getXMLReader(); SAXUnmarshallerHandler saxUnmarshallerHandler = new SAXUnmarshallerHandler(xmlUnmarshaller.getContext()); saxUnmarshallerHandler.setXMLReader(xmlReader); saxUnmarshallerHandler.setUnmarshaller(xmlUnmarshaller); setContentHandler(xmlReader, saxUnmarshallerHandler); xmlReader.parse(systemId); // resolve mapping references saxUnmarshallerHandler.resolveReferences(); return saxUnmarshallerHandler.getObject(); } catch (IOException e) { throw XMLMarshalException.unmarshalException(e); } catch (SAXException e) { throw convertSAXException(e); } finally { xmlUnmarshaller.getStringBuffer().reset(); } }