List of utility methods to do XMLStreamReader
XMLStreamReader | buildXmlStreamReader(String xml) build Xml Stream Reader XMLInputFactory factory = XMLInputFactory.newInstance(); return factory.createXMLStreamReader(new StringReader(xml)); |
void | close(XMLStreamReader r) close try { if (r != null) { r.close(); } catch (XMLStreamException ex) { throw new RuntimeException("Couldn't close xml reader", ex); |
void | close(XMLStreamReader reader) close if (reader != null) {
reader.close();
|
void | close(XMLStreamReader reader) close try { if (reader != null) { reader.close(); } catch (XMLStreamException ignore) { |
XMLStreamReader | createFilteredReader(XMLStreamReader reader, StreamFilter filter) create Filtered Reader XMLInputFactory inputFactory = XMLInputFactory.newInstance(); try { return inputFactory.createFilteredReader(reader, filter); } catch (XMLStreamException e) { throw new RuntimeException("Cant' create XMLStreamReader", e); |
XMLStreamReader | createXMLStreamReader(File file) create XML Stream Reader XMLInputFactory factory = XMLInputFactory.newInstance(); if (factory.isPropertySupported("javax.xml.stream.isValidating")) { factory.setProperty("javax.xml.stream.isValidating", Boolean.TRUE); XMLStreamReader reader = factory.createXMLStreamReader(new FileReader(file)); return reader; |
XMLStreamReader | createXMLStreamReader(InputStream in) create XML Stream Reader try { return infactory.createXMLStreamReader(in); } catch (XMLStreamException e) { throw new RuntimeException("Couldn't create a stream reader.", e); |
XMLStreamReader | createXMLStreamReader(InputStream in, String encoding) create XML Stream Reader XMLInputFactory inputFactory = XMLInputFactory.newInstance();
XMLStreamReader reader = inputFactory.createXMLStreamReader(in, encoding);
return reader;
|
XMLStreamReader | createXMLStreamReaderFromReader(final Reader reader) Creates an XML stream reader from the specified input stream. XMLInputFactory xmlif = null;
xmlif = XMLInputFactory.newInstance();
xmlif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.TRUE);
xmlif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
xmlif.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE);
return xmlif.createXMLStreamReader(reader);
|
DataHandler | decodeAsDataHandler(XMLStreamReader reader, AttachmentUnmarshaller au) decode As Data Handler return null;
|