jlibs.xml.stream
Class STAXXMLReader
java.lang.Object
jlibs.xml.sax.BaseXMLReader
jlibs.xml.sax.AbstractXMLReader
jlibs.xml.stream.STAXXMLReader
- All Implemented Interfaces:
- XMLReader
public class STAXXMLReader
- extends AbstractXMLReader
XMLReader implementation using STAX.
This class also provides handy utility method fire(...)
to translate STAX events to SAX events.
XMLStreamReader reader = ...;
SAXDelegate delegate = new SAXDelegate();
// set any handlers you are interested
delegate.setContentHandler(myContentHandler);
delegate.setErrorHandler(myErrorHandler);
STAXXMLReader.fire(reader, delegate);
- Author:
- Santhosh Kumar T
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
STAXXMLReader
public STAXXMLReader(XMLInputFactory factory)
STAXXMLReader
public STAXXMLReader()
parse
public void parse(InputSource input)
throws IOException,
SAXException
- Throws:
IOException
SAXException
parse
public void parse(String systemId)
throws IOException,
SAXException
- Throws:
IOException
SAXException
fire
public static void fire(XMLStreamReader reader,
SAXDelegate handler)
throws SAXException
- Reads data from specified
reader, and delegates translated SAX Events
to handler.
Note: The reader is not closed by this method.
- Parameters:
reader - reader to reads data fromhandler - the SAXHandler which receives SAX events
- Throws:
SAXException - any XMLStreamException occured is rethrown as SAXException
Copyright © 2015. All rights reserved.