Package com.ctc.wstx.exc

Examples of com.ctc.wstx.exc.WstxIOException


    {
        try {
            return createSR(cfg, src, URLUtil.optimizedStreamFromURL(src),
                            forER, autoCloseInput);
        } 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

            if (vlen <= buf.length) {
                nsURI.getChars(0, vlen, buf, 0);
                try {
                    mWriter.writeAttribute(XMLConstants.XMLNS_ATTRIBUTE, prefix, buf, 0, vlen);
                } catch (IOException ioe) {
                    throw new WstxIOException(ioe);
                }
                return;
            }
        }
        try {
            mWriter.writeAttribute(XMLConstants.XMLNS_ATTRIBUTE, prefix, nsURI);
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }
    }
View Full Code Here

            if (vlen <= buf.length) {
                nsURI.getChars(0, vlen, buf, 0);
                try {
                    mWriter.writeAttribute(XMLConstants.XMLNS_ATTRIBUTE, buf, 0, vlen);
                } catch (IOException ioe) {
                    throw new WstxIOException(ioe);
                }
                return;
            }
        }
        try {
            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

                    return;
                }
                // Nah, need to close open elem, and then output close elem
                mWriter.writeStartTagEnd();
            } catch (IOException ioe) {
                throw new WstxIOException(ioe);
            }
        }

        try {
            mWriter.writeEndTag(prefix, localName);
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }

        if (mCurrElem.isRoot()) {
            mState = STATE_EPILOG;
        }
View Full Code Here

                mWriter.writeTypedElement(enc);
            } else {
                mWriter.writeTypedElement(enc, vld, getCopyBuffer());
            }
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }
    }
View Full Code Here

                out = sr.constructOutputStream();
                if (out == null) {
                    w = sr.constructWriter();
                }
            } catch (IOException ioe) {
                throw new WstxIOException(ioe);
            }
            // yes, it's required since caller has no access to stream/writer:
            requireAutoClose = true;
        } else if (res instanceof StreamResult) {
            StreamResult sr = (StreamResult) res;
            out = sr.getOutputStream();
            sysId = sr.getSystemId();
            if (out == null) {
                w = sr.getWriter();
            }
            /* Caller owns it, only auto-close if requested to do so:
             * (except that for system-id-only, it'll still be required,
             * see code below)
             */
            requireAutoClose = false;
        } else if (res instanceof SAXResult) {
            SAXResult sr = (SAXResult) res;
            sysId = sr.getSystemId();
            if (sysId == null || sysId.length() == 0) {
                throw new XMLStreamException("Can not create a stream writer for a SAXResult that does not have System Id (support for using SAX input source not implemented)");
            }
            requireAutoClose = true;
        } else if (res instanceof DOMResult) {
            return WstxDOMWrappingWriter.createFrom(mConfig.createNonShared(), (DOMResult) res);
        } else {
            throw new IllegalArgumentException("Can not instantiate a writer for XML result type "+res.getClass()+" (unrecognized type)");
        }

        if (out != null) {
            return createSW(out, null, encoding, requireAutoClose);
        }
        if (w != null) {
            return createSW(null, w, encoding, requireAutoClose);
        }
        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.
             */
            requireAutoClose = true;
            try {
                out = URLUtil.outputStreamFromURL(URLUtil.urlFromSystemId(sysId));
            } catch (IOException ioe) {
                throw new WstxIOException(ioe);
            }
            return createSW(out, null, encoding, requireAutoClose);
        }
        throw new XMLStreamException("Can not create Stax writer for passed-in Result -- neither writer, output stream or system id was accessible");
    }
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.