Package com.ctc.wstx.api

Examples of com.ctc.wstx.api.ReaderConfig


    public XMLValidationSchema createSchema(InputStream in, String encoding,
                                           String publicId, String systemId)
        throws XMLStreamException
    {
        ReaderConfig rcfg = createPrivateReaderConfig();
        return doCreateSchema(rcfg, StreamBootstrapper.getInstance
                              (publicId, systemId, in), publicId, systemId, null);
    }
View Full Code Here


    public XMLValidationSchema createSchema(Reader r, String publicId,
                                           String systemId)
        throws XMLStreamException
    {
        ReaderConfig rcfg = createPrivateReaderConfig();
        return doCreateSchema(rcfg, ReaderBootstrapper.getInstance
                              (publicId, systemId, r, null), publicId, systemId, null);
    }
View Full Code Here

    }

    public XMLValidationSchema createSchema(URL url)
        throws XMLStreamException
    {
        ReaderConfig rcfg = createPrivateReaderConfig();
        try {
            InputStream in = URLUtil.inputStreamFromURL(url);
            return doCreateSchema(rcfg, StreamBootstrapper.getInstance
                                  (null, null, in),
                                  null, url.toExternalForm(), url);
View Full Code Here

    }

    public XMLValidationSchema createSchema(File f)
        throws XMLStreamException
    {
        ReaderConfig rcfg = createPrivateReaderConfig();
        try {
            URL url = URLUtil.toURL(f);
            return doCreateSchema(rcfg, StreamBootstrapper.getInstance
                                  (null, null, new FileInputStream(f)),
                                  null, url.toExternalForm(), url);
View Full Code Here

                                                  boolean inclComments, boolean inclConditionals,
                                                  boolean inclPEs)
        throws IOException, XMLStreamException
    {
        int configFlags = -1; // let's start with all options set, first
        ReaderConfig cfg = ReaderConfig.createFullDefaults();
        // Need to create a non-shared copy to populate symbol table field
        cfg = cfg.createNonShared(new SymbolTable());

        /* Let's actually not normalize LFs; it's likely caller wouldn't
         * really want any such changes....
         */
        cfg.clearConfigFlag(CFG_NORMALIZE_LFS);
        cfg.clearConfigFlag(CFG_NORMALIZE_ATTR_VALUES);

        /* Let's assume xml 1.0... can be taken as an arg later on, if we
         * truly care.
         */
        FullDTDReader r = new FullDTDReader(src, cfg, null, true, XmlConsts.XML_V_UNKNOWN);
View Full Code Here

    public XMLValidationSchema createSchema(InputStream in, String encoding,
                                           String publicId, String systemId)
        throws XMLStreamException
    {
        ReaderConfig rcfg = createPrivateReaderConfig();
        return doCreateSchema(rcfg, StreamBootstrapper.getInstance
                              (in, publicId, systemId), publicId, systemId, null);
    }
View Full Code Here

    public XMLValidationSchema createSchema(Reader r, String publicId,
                                           String systemId)
        throws XMLStreamException
    {
        ReaderConfig rcfg = createPrivateReaderConfig();
        return doCreateSchema(rcfg, ReaderBootstrapper.getInstance
                              (r, publicId, systemId, null), publicId, systemId, null);
    }
View Full Code Here

    }

    public XMLValidationSchema createSchema(URL url)
        throws XMLStreamException
    {
        ReaderConfig rcfg = createPrivateReaderConfig();
        try {
            InputStream in = URLUtil.optimizedStreamFromURL(url);
            return doCreateSchema(rcfg, StreamBootstrapper.getInstance
                                  (in, null, null),
                                  null, url.toExternalForm(), url);
View Full Code Here

    }

    public XMLValidationSchema createSchema(File f)
        throws XMLStreamException
    {
        ReaderConfig rcfg = createPrivateReaderConfig();
        try {
            URL url = f.toURL();
            return doCreateSchema(rcfg, StreamBootstrapper.getInstance
                                  (new FileInputStream(f), null, null),
                                  null, url.toExternalForm(), url);
View Full Code Here

    public void parse(InputSource input)
        throws SAXException
    {
        mScanner = null;
        String systemId = input.getSystemId();
        ReaderConfig cfg = mConfig;
        URL srcUrl = null;

        // Let's figure out input, first, before sending start-doc event
        InputStream is = null;
        Reader r = input.getCharacterStream();
        if (r == null) {
            is = input.getByteStream();
            if (is == null) {
                if (systemId == null) {
                    throw new SAXException("Invalid InputSource passed: neither character or byte stream passed, nor system id specified");
                }
                try {
                    srcUrl = URLUtil.urlFromSystemId(systemId);
                    is = URLUtil.optimizedStreamFromURL(srcUrl);
                } catch (IOException ioe) {
                    SAXException saxe = new SAXException(ioe);
                    saxe.initCause(ioe);
                    throw saxe;
                }
            }
        }

        if (mContentHandler != null) {
            mContentHandler.setDocumentLocator(this);
            mContentHandler.startDocument();
        }

        try {
            InputBootstrapper bs;
            String inputEnc = input.getEncoding();
            String publicId = input.getPublicId();
            if (r != null) {
                bs = ReaderBootstrapper.getInstance(r, publicId, systemId, inputEnc);
            } else {
                bs = StreamBootstrapper.getInstance(is, publicId, systemId);
            }
            /* Note: since we are reusing the same config instance, need to
             * make sure state is not carried forward. Thus:
             */
            cfg.resetState();
            // false -> not for event reader; false -> no auto-closing
            mScanner = (BasicStreamReader) mStaxFactory.createSR(cfg, systemId, bs, false, false);

            // Need to get xml declaration stuff out now:
            {
View Full Code Here

TOP

Related Classes of com.ctc.wstx.api.ReaderConfig

Copyright © 2018 www.massapicom. 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.