/** * Primes a converter with a SAX handler. * * Note: if handler is also LexicalHandler it will pass on lexical events. * */ public AsyncJenaParser(ContentHandler handler, AsyncXMLStreamReader streamReader) throws XMLStreamException { this.handler = handler; this.lhandler = (handler instanceof LexicalHandler) ? (LexicalHandler) handler : NO_LEXICAL_HANDLER ; handler.setDocumentLocator(new LocatorConv(streamReader)); final XMLInputFactory xf = InputFactoryImpl.newInstance(); this.streamReader = streamReader; this.eventReader = xf.createXMLEventReader(streamReader); }