Examples of NestedIOException


Examples of org.exolab.castor.util.NestedIOException

            if (sx instanceof SAXParseException) {
                sxp = (SAXParseException) sx;
            } else if (nested != null && (nested instanceof SAXParseException)) {
                sxp = (SAXParseException) nested;
            } else {
                throw new NestedIOException(sx);
            }

            StringBuffer err = new StringBuffer(sxp.toString());
            err.append("\n - ");
            err.append(sxp.getSystemId());
            err.append("; line: ");
            err.append(sxp.getLineNumber());
            err.append(", column: ");
            err.append(sxp.getColumnNumber());
            throw new NestedIOException(err.toString(), sx);
        }

        Root root = (Root) node;
        return root;
    }
View Full Code Here

Examples of org.exolab.castor.util.NestedIOException

                try {
                    URILocation location = resolver.resolve(uri, null);
                    if (location != null) uri = location.toString();
                }
                catch(URIException except) {
                    throw new NestedIOException(except);
                }
                state.markAsProcessed(uri, schemaUnmarshaller.getSchema());
            }
           
            Sax2ComponentReader handler
                = new Sax2ComponentReader(schemaUnmarshaller);
            _parser.setDocumentHandler(handler);
           
            if (_errorHandler == null)
                _parser.setErrorHandler(handler);
            else
                _parser.setErrorHandler(_errorHandler);
               
            if (_resolver != null)
                _parser.setEntityResolver(_resolver);
            _parser.parse(_source);
        }
        catch(XMLException ex) {
            handleException(ex);
        }
        catch(org.xml.sax.SAXException sx) {
            handleException(sx);
        }

        _schema = schemaUnmarshaller.getSchema();

        if (_validate) {
            try {
                _schema.validate();
            }
            catch(org.exolab.castor.xml.ValidationException vx) {
                throw new NestedIOException(vx);
            }
        }

        return _schema;
View Full Code Here

Examples of org.exolab.castor.util.NestedIOException

     * @throws IOException
     */
    private void handleException(XMLException xmlException)
        throws IOException
    {
        throw new NestedIOException(xmlException);
    } //-- handleException
View Full Code Here

Examples of org.exolab.castor.util.NestedIOException

            String err = spe.getMessage();

            err += "; " + filename + " [ line: " + spe.getLineNumber();
            err += ", column: " + spe.getColumnNumber() + ']';
            throw new NestedIOException(err, except);
        }
        else if (except instanceof XMLException) {
            handleException((XMLException)except);
        }

        throw new NestedIOException(except);

    } //-- handleException
View Full Code Here

Examples of org.exolab.castor.util.NestedIOException

            }
            parser.setDocumentHandler(handler);
            parser.setErrorHandler(handler);
            parser.parse(source);
        } catch (org.xml.sax.SAXException sx) {
            throw new NestedIOException(sx);
        }
        return handler.getSchema();
    }
View Full Code Here

Examples of org.exolab.castor.util.NestedIOException

        Schema schema = schemaUnmarshaller.getSchema();
       
        try {
            schema.validate();
        } catch (ValidationException vx) {
            throw new NestedIOException(vx);
        }
       
        generateSource(schema, packageName);
    } //-- generateSource
View Full Code Here

Examples of org.exolab.castor.util.NestedIOException

        try {
            Marshaller marshaller = new Marshaller(writer);
            marshaller.setSuppressNamespaces(true);
            marshaller.marshal(mapping);
        } catch (Exception ex) {
            throw new NestedIOException(ex);
        } finally {
            writer.flush();
            writer.close();
        }
    }
View Full Code Here

Examples of org.exolab.castor.util.NestedIOException

                try {
                    URILocation location = resolver.resolve(uri, null);
                    if (location != null) uri = location.toString();
                }
                catch(URIException except) {
                    throw new NestedIOException(except);
                }
                state.markAsProcessed(uri, schemaUnmarshaller.getSchema());
            }
           
            Sax2ComponentReader handler
                = new Sax2ComponentReader(schemaUnmarshaller);
            _parser.setDocumentHandler(handler);
           
            if (_errorHandler == null)
                _parser.setErrorHandler(handler);
            else
                _parser.setErrorHandler(_errorHandler);
               
            if (_resolver != null)
                _parser.setEntityResolver(_resolver);
            _parser.parse(_source);
        }
        catch(XMLException ex) {
            handleException(ex);
        }
        catch(org.xml.sax.SAXException sx) {
            handleException(sx);
        }

        _schema = schemaUnmarshaller.getSchema();

        if (_validate) {
            try {
                _schema.validate();
            }
            catch(org.exolab.castor.xml.ValidationException vx) {
                throw new NestedIOException(vx);
            }
        }

        return _schema;
View Full Code Here

Examples of org.exolab.castor.util.NestedIOException

     * @throws IOException
     */
    private void handleException(XMLException xmlException)
        throws IOException
    {
        throw new NestedIOException(xmlException);
    } //-- handleException
View Full Code Here

Examples of org.exolab.castor.util.NestedIOException

            String err = spe.getMessage();

            err += "; " + filename + " [ line: " + spe.getLineNumber();
            err += ", column: " + spe.getColumnNumber() + ']';
            throw new NestedIOException(err, except);
        }
        else if (except instanceof XMLException) {
            handleException((XMLException)except);
        }

        throw new NestedIOException(except);

    } //-- handleException
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.