Examples of StreamExceptionBase


Examples of com.fasterxml.aalto.StreamExceptionBase

     */

    protected static void throwOutputError(String msg)
        throws XMLStreamException
    {
        throw new StreamExceptionBase(msg);
    }
View Full Code Here

Examples of com.fasterxml.aalto.StreamExceptionBase

    {
        /* Should probably have a specific exception for Writer
         * side? For now, let's at least use base class we
         * control, which gives slightly better output.
         */
        throw new StreamExceptionBase(msg, loc);
    }
View Full Code Here

Examples of com.fasterxml.aalto.StreamExceptionBase

                out = sr.constructOutputStream();
                if (out == null) {
                    w = sr.constructWriter();
                }
            } catch (IOException ioe) {
                throw new StreamExceptionBase(ioe);
            }
            autoclose = true;
        } else if (res instanceof StreamResult) {
            StreamResult sr = (StreamResult) res;
            sysId = sr.getSystemId();
            out = sr.getOutputStream();
            if (out == null) {
                w = sr.getWriter();
            }
            autoclose = false; // caller still owns it, no automatic close
        } else if (res instanceof SAXResult) {
            SAXResult sr = (SAXResult) res;
            sysId = sr.getSystemId();
            if (sysId == null || sysId.length() == 0) {
                throw new StreamExceptionBase("Can not create a stream writer for a SAXResult that does not have System Id (support for using SAX input source not implemented)");
            }
            autoclose = true;
        } else if (res instanceof DOMResult) {
            return DOMWriterImpl.createFrom(_config.createNonShared(), (DOMResult) res);
        } else {
            throw new IllegalArgumentException("Can not create XMLStreamWriter for Result type "+res.getClass()+" (unrecognized type)");
        }

        if (out != null) {
            return createSW(out, null, encoding, autoclose);
        }
        if (w != null) {
            return createSW(null, w, encoding, autoclose);
        }
        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.
             */
            autoclose = true;
            try {
                out = URLUtil.outputStreamFromURL(URLUtil.urlFromSystemId(sysId));
            } catch (IOException ioe) {
                throw new IoStreamException(ioe);
            }
            return createSW(out, null, encoding, autoclose);
        }
        throw new StreamExceptionBase("Can not create XMLStreamWriter for passed-in Result -- neither writer, output stream nor system id (to create one) was accessible");
    }
View Full Code Here

Examples of com.fasterxml.aalto.impl.StreamExceptionBase

    {
        /* Should probably have a specific exception for Writer
         * side? For now, let's at least use base class we
         * control, which gives slightly better output.
         */
        throw new StreamExceptionBase(msg, loc);
    }
View Full Code Here

Examples of com.fasterxml.aalto.impl.StreamExceptionBase

     */

    protected static void throwOutputError(String msg)
        throws XMLStreamException
    {
        throw new StreamExceptionBase(msg);
    }
View Full Code Here

Examples of com.fasterxml.aalto.impl.StreamExceptionBase

                out = sr.constructOutputStream();
                if (out == null) {
                    w = sr.constructWriter();
                }
            } catch (IOException ioe) {
                throw new StreamExceptionBase(ioe);
            }
            autoclose = true;
        } else if (res instanceof StreamResult) {
            StreamResult sr = (StreamResult) res;
            sysId = sr.getSystemId();
            out = sr.getOutputStream();
            if (out == null) {
                w = sr.getWriter();
            }
            autoclose = false; // caller still owns it, no automatic close
        } else if (res instanceof SAXResult) {
            SAXResult sr = (SAXResult) res;
            sysId = sr.getSystemId();
            if (sysId == null || sysId.length() == 0) {
                throw new StreamExceptionBase("Can not create a stream writer for a SAXResult that does not have System Id (support for using SAX input source not implemented)");
            }
            autoclose = true;
        } else if (res instanceof DOMResult) {
            return DOMWriterImpl.createFrom(_config.createNonShared(), (DOMResult) res);
        } else {
            throw new IllegalArgumentException("Can not create XMLStreamWriter for Result type "+res.getClass()+" (unrecognized type)");
        }

        if (out != null) {
            return createSW(out, null, encoding, autoclose);
        }
        if (w != null) {
            return createSW(null, w, encoding, autoclose);
        }
        if (sysId != null && sysId.length() > 0) {
            /* 26-Dec-2008, tatu: If we must construct URL from system id,
             *   it means caller will not have access to resulting
             *   stream, thus we will force auto-closing.
             */
            autoclose = true;
            try {
                out = URLUtil.outputStreamFromURL(URLUtil.urlFromSystemId(sysId));
            } catch (IOException ioe) {
                throw new IoStreamException(ioe);
            }
            return createSW(out, null, encoding, autoclose);
        }
        throw new StreamExceptionBase("Can not create XMLStreamWriter for passed-in Result -- neither writer, output stream nor system id (to create one) was accessible");
    }
View Full Code Here

Examples of com.fasterxml.aalto.impl.StreamExceptionBase

                out = sr.constructOutputStream();
                if (out == null) {
                    w = sr.constructWriter();
                }
            } catch (IOException ioe) {
                throw new StreamExceptionBase(ioe);
            }
            autoclose = true;
        } else if (res instanceof StreamResult) {
            StreamResult sr = (StreamResult) res;
            sysId = sr.getSystemId();
            out = sr.getOutputStream();
            if (out == null) {
                w = sr.getWriter();
            }
            autoclose = false; // caller still owns it, no automatic close
        } else if (res instanceof SAXResult) {
            SAXResult sr = (SAXResult) res;
            sysId = sr.getSystemId();
            if (sysId == null || sysId.length() == 0) {
                throw new StreamExceptionBase("Can not create a stream writer for a SAXResult that does not have System Id (support for using SAX input source not implemented)");
            }
            autoclose = true;
        } else if (res instanceof DOMResult) {
            return DOMWriterImpl.createFrom(_config.createNonShared(), (DOMResult) res);
        } else {
            throw new IllegalArgumentException("Can not create XMLStreamWriter for Result type "+res.getClass()+" (unrecognized type)");
        }

        if (out != null) {
            return createSW(out, null, encoding, autoclose);
        }
        if (w != null) {
            return createSW(null, w, encoding, autoclose);
        }
        if (sysId != null && sysId.length() > 0) {
            /* 26-Dec-2008, tatu: If we must construct URL from system id,
             *   it means caller will not have access to resulting
             *   stream, thus we will force auto-closing.
             */
            autoclose = true;
            try {
                out = URLUtil.outputStreamFromURL(URLUtil.urlFromSystemId(sysId));
            } catch (IOException ioe) {
                throw new IoStreamException(ioe);
            }
            return createSW(out, null, encoding, autoclose);
        }
        throw new StreamExceptionBase("Can not create XMLStreamWriter for passed-in Result -- neither writer, output stream nor system id (to create one) was accessible");
    }
View Full Code Here

Examples of com.fasterxml.aalto.impl.StreamExceptionBase

    {
        /* Should probably have a specific exception for Writer
         * side? For now, let's at least use base class we
         * control, which gives slightly better output.
         */
        throw new StreamExceptionBase(msg, loc);
    }
View Full Code Here

Examples of com.fasterxml.aalto.impl.StreamExceptionBase

     */

    protected static void throwOutputError(String msg)
        throws XMLStreamException
    {
        throw new StreamExceptionBase(msg);
    }
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.