Package com.ctc.wstx.exc

Examples of com.ctc.wstx.exc.WstxIOException


                    return createSR(cfg, src, URLUtil.inputStreamFromURL(src), forER, autoCloseInput);
                }
            }
            return createSR(cfg, f.toURL(), new FileInputStream(f), forER, autoCloseInput);
        } catch (IOException ie) {
            throw new WstxIOException(ie);
        }
    }
View Full Code Here


        if (in == null) {
      r = ss.constructReader();
        }
    }
            } catch (IOException ioe) {
                throw new WstxIOException(ioe);
            }
            /* Caller has no direct access to stream/reader, Woodstox
             * owns it and thus has to close too
             */
            autoCloseInput = true;
        } else  if (src instanceof StreamSource) {
            StreamSource ss = (StreamSource) src;
            sysId = ss.getSystemId();
            pubId = ss.getPublicId();
            in = ss.getInputStream();
            if (in == null) {
                r = ss.getReader();
            }
            /* Caller still has access to stream/reader; no need to
             * force auto-close-input
             */
            autoCloseInput = cfg.willAutoCloseInput();
        } else if (src instanceof SAXSource) {
            SAXSource ss = (SAXSource) src;
            /* 28-Jan-2006, TSa: Not a complete implementation, but maybe
             *   even this might help...
             */
            sysId = ss.getSystemId();
            InputSource isrc = ss.getInputSource();
            if (isrc != null) {
                encoding = isrc.getEncoding();
                in = isrc.getByteStream();
                if (in == null) {
                    r = isrc.getCharacterStream();
                }
            }
            /* Caller still has access to stream/reader; no need to
             * force auto-close-input
             */
            autoCloseInput = cfg.willAutoCloseInput();
        } else if (src instanceof DOMSource) {
            DOMSource domSrc = (DOMSource) src;
            // SymbolTable not used by the DOM-based 'reader':
            return WstxDOMWrappingReader.createFrom(domSrc, cfg);
        } else {
            throw new IllegalArgumentException("Can not instantiate Stax reader for XML source type "+src.getClass()+" (unrecognized type)");
        }
  if (bs == null) { // may have already created boostrapper...
      if (r != null) {
    bs = ReaderBootstrapper.getInstance(pubId, sysId, r, encoding);
      } else if (in != null) {
    bs = StreamBootstrapper.getInstance(pubId, sysId, in);
      } else if (sysId != null && sysId.length() > 0) {
                /* 26-Dec-2008, TSa: If we must construct URL from system id,
                 *   it means caller will not have access to resulting
                 *   stream, thus we will force auto-closing.
                 */
                autoCloseInput = true;
    try {
        return createSR(cfg, URLUtil.urlFromSystemId(sysId),
            forER, autoCloseInput);
    } catch (IOException ioe) {
        throw new WstxIOException(ioe);
    }
      } else {
    throw new XMLStreamException("Can not create Stax reader for the Source passed -- neither reader, input stream nor system id was accessible; can not use other types of sources (like embedded SAX streams)");
      }
  }
View Full Code Here

            } else {
                mWriter.writeTypedAttribute
                    (prefix, localName, nsURI, enc, mValidator, getCopyBuffer());
            }
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }
    }
View Full Code Here

                mWriter.writeStartTagEmptyEnd();
            } else {
                mWriter.writeStartTagEnd();
            }
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }

        if (mValidator != null) {
            mVldContent = mValidator.validateElementAndAttributes();
        }
View Full Code Here

                mWriter.writeAttribute(prefix, localName, value);
            } else {
                mWriter.writeAttribute(localName, value);
            }
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }
    }
View Full Code Here

                mWriter.writeAttribute(prefix, localName, buf, start, len);
            } else {
                mWriter.writeAttribute(localName, buf, start, len);
            }
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }
    }
View Full Code Here

                    return;
                }
            }
            mWriter.writeAttribute(XMLConstants.XMLNS_ATTRIBUTE, prefix, nsURI);
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }
    }
View Full Code Here

                    return;
                }
            }
            mWriter.writeAttribute(XMLConstants.XMLNS_ATTRIBUTE, nsURI);
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }
    }
View Full Code Here

        mAnyOutput = true;
        mStartElementOpen = true;
        try {
            mWriter.writeStartTagStart(localName);
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }
    }
View Full Code Here

                mWriter.writeStartTagStart(prefix, localName);
            } else {
                mWriter.writeStartTagStart(localName);
            }
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }
    }
View Full Code Here

TOP

Related Classes of com.ctc.wstx.exc.WstxIOException

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.