Package org.dom4j

Examples of org.dom4j.DocumentException


                String message = "Error on line "
                        + parseException.getLineNumber() + " of document "
                        + systemId + " : " + parseException.getMessage();

                throw new DocumentException(message, e);
            } else {
                throw new DocumentException(e.getMessage(), e);
            }
        }
    }
View Full Code Here


            } else {
                reader.setErrorHandler(handler);
            }
        } catch (Exception e) {
            if (isValidating()) {
                throw new DocumentException("Validation not supported for"
                        + " XMLReader: " + reader, e);
            }
        }
    }
View Full Code Here

    public void setDomDocumentClassName(String name) throws DocumentException {
        try {
            this.domDocumentClass = Class.forName(name, true, DOMWriter.class
                    .getClassLoader());
        } catch (Exception e) {
            throw new DocumentException("Could not load the DOM Document "
                    + "class: " + name, e);
        }
    }
View Full Code Here

        // use the given domDocumentClass (if not null)
        if (domDocumentClass != null) {
            try {
                result = (org.w3c.dom.Document) domDocumentClass.newInstance();
            } catch (Exception e) {
                throw new DocumentException(
                        "Could not instantiate an instance "
                                + "of DOM Document with class: "
                                + domDocumentClass.getName(), e);
            }
        } else {
            // lets try JAXP first before using the hardcoded default parsers
            result = createDomDocumentViaJAXP();

            if (result == null) {
                Class theClass = getDomDocumentClass();

                try {
                    result = (org.w3c.dom.Document) theClass.newInstance();
                } catch (Exception e) {
                    throw new DocumentException("Could not instantiate an "
                            + "instance of DOM Document " + "with class: "
                            + theClass.getName(), e);
                }
            }
        }
View Full Code Here

                    charset);

            return getReader().read(xmlReader);
        } catch (JAXBRuntimeException ex) {
            Throwable cause = ex.getCause();
            throw new DocumentException(cause.getMessage(), cause);
        } catch (FileNotFoundException ex) {
            throw new DocumentException(ex.getMessage(), ex);
        }
    }
View Full Code Here

    public Document read(InputSource source) throws DocumentException {
        try {
            return getReader().read(source);
        } catch (JAXBRuntimeException ex) {
            Throwable cause = ex.getCause();
            throw new DocumentException(cause.getMessage(), cause);
        }
    }
View Full Code Here

    public Document read(InputStream source) throws DocumentException {
        try {
            return getReader().read(source);
        } catch (JAXBRuntimeException ex) {
            Throwable cause = ex.getCause();
            throw new DocumentException(cause.getMessage(), cause);
        }
    }
View Full Code Here

            throws DocumentException {
        try {
            return getReader().read(source);
        } catch (JAXBRuntimeException ex) {
            Throwable cause = ex.getCause();
            throw new DocumentException(cause.getMessage(), cause);
        }
    }
View Full Code Here

    public Document read(Reader source) throws DocumentException {
        try {
            return getReader().read(source);
        } catch (JAXBRuntimeException ex) {
            Throwable cause = ex.getCause();
            throw new DocumentException(cause.getMessage(), cause);
        }
    }
View Full Code Here

            throws DocumentException {
        try {
            return getReader().read(source);
        } catch (JAXBRuntimeException ex) {
            Throwable cause = ex.getCause();
            throw new DocumentException(cause.getMessage(), cause);
        }
    }
View Full Code Here

TOP

Related Classes of org.dom4j.DocumentException

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.