Examples of ReaderConfig


Examples of com.fasterxml.aalto.in.ReaderConfig

    /**********************************************************************
     */

    public InputFactoryImpl()
    {
        _config = new ReaderConfig();
    }
View Full Code Here

Examples of com.fasterxml.aalto.in.ReaderConfig

    @Override
    public AsyncXMLStreamReader createAsyncXMLStreamReader()
    {
      // TODO: pass system and/or public ids?
      ReaderConfig cfg = getNonSharedConfig(null, null, null, false, false);
      cfg.setActualEncoding("UTF-8");
      return new AsyncStreamReaderImpl(new AsyncUtfScanner(cfg));
    }
View Full Code Here

Examples of com.fasterxml.aalto.in.ReaderConfig

    }
   
    public AsyncXMLStreamReader createAsyncXMLStreamReader(final IllegalCharHandler illegalCharHandler)
    {
      // TODO: pass system and/or public ids?
      ReaderConfig cfg = getNonSharedConfig(null, null, null, false, false);
      cfg.setActualEncoding("UTF-8");
      cfg.setIllegalCharHandler(illegalCharHandler);
      return new AsyncStreamReaderImpl(new AsyncUtfScanner(cfg));
    }
View Full Code Here

Examples of com.fasterxml.aalto.in.ReaderConfig

    public ReaderConfig getNonSharedConfig(String systemId, String publicId,
                                           String extEncoding,
                                           boolean forEventReader,
                                           boolean forceAutoClose)
    {
        ReaderConfig cfg = _config.createNonShared(publicId, systemId, extEncoding);
        if (forEventReader) {
            /* No point in lazy parsing for event readers: no more efficient
             * (and possible less) since all data is needed, always; and
             * exceptions also get lazily thrown after the fact.
             */
            cfg.doParseLazily(false);
        }
        if (forceAutoClose) {
            cfg.doAutoCloseInput(true);
        }
        return cfg;
    }
View Full Code Here

Examples of com.fasterxml.aalto.in.ReaderConfig

    protected XMLStreamReader2 constructSR(InputStream in, String enc,
            boolean forEventReader)
        throws XMLStreamException
    {
        ReaderConfig cfg = getNonSharedConfig(null, null, enc, forEventReader, false);
        return StreamReaderImpl.construct(ByteSourceBootstrapper.construct(cfg, in));
    }
View Full Code Here

Examples of com.fasterxml.aalto.in.ReaderConfig

    protected XMLStreamReader2 constructSR(String systemId, Reader r,
                                           boolean forEventReader)
        throws XMLStreamException
    {
        ReaderConfig cfg = getNonSharedConfig(null, systemId, null, forEventReader, false);
        return StreamReaderImpl.construct(CharSourceBootstrapper.construct(cfg, r));
    }
View Full Code Here

Examples of com.fasterxml.aalto.in.ReaderConfig

    protected XMLStreamReader2 constructSR(String systemId, InputStream in,
                                        boolean forEventReader)
        throws XMLStreamException
    {
        ReaderConfig cfg = getNonSharedConfig(null, systemId, null, forEventReader, false);
        return StreamReaderImpl.construct(ByteSourceBootstrapper.construct(cfg, in));
    }
View Full Code Here

Examples of com.fasterxml.aalto.in.ReaderConfig

             * get system-id); no need to force auto-close here
             */
            autoCloseInput = false;
        } else if (src instanceof DOMSource) {
            autoCloseInput = false; // shouldn't matter
            ReaderConfig cfg = getNonSharedConfig(pubId, sysId, encoding, forEventReader, autoCloseInput);
            return DOMReaderImpl.createFrom((DOMSource) src, cfg);
        } else {
            throw new IllegalArgumentException("Can not instantiate StAX reader for XML source type "+src.getClass()+" (unrecognized type)");
        }
        if (in != null) {
            ReaderConfig cfg = getNonSharedConfig(pubId, sysId, encoding, forEventReader, autoCloseInput);
            return StreamReaderImpl.construct(ByteSourceBootstrapper.construct(cfg, in));
        }
        if (r != null) {
            ReaderConfig cfg = getNonSharedConfig(pubId, sysId, encoding, forEventReader, autoCloseInput);
            return StreamReaderImpl.construct(CharSourceBootstrapper.construct(cfg, r));
        }
        if (sysId != null && sysId.length() > 0) {
            /* If we must construct URL from system id, caller will not have
             * access to resulting stream, need to force auto-closing.
             */
            autoCloseInput = true;
            ReaderConfig cfg = getNonSharedConfig(pubId, sysId, encoding, forEventReader, autoCloseInput);
            try {
                URL url = URLUtil.urlFromSystemId(sysId);
                in = URLUtil.inputStreamFromURL(url);
                return StreamReaderImpl.construct(ByteSourceBootstrapper.construct(cfg, in));
            } catch (IOException ioe) {
View Full Code Here

Examples of com.fasterxml.aalto.in.ReaderConfig

        throws XMLStreamException
    {
        /* Caller has no access to these input sources, so we must force
         * auto-close ('true' after 'forEventReader')
         */
        ReaderConfig cfg = getNonSharedConfig(ss.getPublicId(), ss.getSystemId(), ss.getEncoding(), forEventReader, true);

        // Byte arrays can be accessed VERY efficiently...
        if (ss instanceof Stax2ByteArraySource) {
            Stax2ByteArraySource bs = (Stax2ByteArraySource) ss;
            return StreamReaderImpl.construct(ByteSourceBootstrapper.construct
View Full Code Here

Examples of com.fasterxml.aalto.in.ReaderConfig

            in = URLUtil.inputStreamFromURL(src);
        } catch (IOException ioe) {
            throw new IoStreamException(ioe);
        }
        // Construct from URL? Must auto-close:
        ReaderConfig cfg = getNonSharedConfig(URLUtil.urlToSystemId(src), null, null, forEventReader, true);
        return StreamReaderImpl.construct(ByteSourceBootstrapper.construct(cfg, in));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.