Package org.dom4j

Examples of org.dom4j.DocumentException


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


    Document document = null;
    if (inputFile.isFile()) {
      SAXReader reader = new SAXReader();
      document = reader.read(inputFile);
    } else {
      throw new DocumentException("Unable to read " + inputFile + ".");
    }
    return document;
  }
View Full Code Here

                if (verbose) {
                    e2.printStackTrace();
                }
                throw e2;
            } catch (DocumentException e) {
                DocumentException e2 = new DocumentException("Error parsing " + newFilename);
                e2.initCause(e);
                if (verbose) {
                    e2.printStackTrace();
                }
                throw e2;
            }
        }
        /*
 
View Full Code Here

        try {
            readXML(in, file);
        } catch (IOException e) {
            throw newIOException(file, e);
        } catch (DocumentException e) {
            throw new DocumentException("Failing reading " + file, e);
        }
    }
View Full Code Here

        try {
            readXML(in);
        } catch (IOException e) {
            throw newIOException(u, e);
        } catch (DocumentException e) {
            throw new DocumentException("Failing reading " + u, e);
        }
    }
View Full Code Here

            XMLReader xr;
            try {
                xr = XMLReaderFactory.createXMLReader();
            } catch (SAXException e) {
                AnalysisContext.logError("Couldn't create XMLReaderFactory", e);
                throw new DocumentException("Sax error ", e);
            }
            xr.setContentHandler(handler);
            xr.setErrorHandler(handler);

            xr.parse(new InputSource(reader));
        } catch (SAXParseException e) {
            if (base != null) {
                throw new DocumentException("Parse error at line " + e.getLineNumber() + " : " + e.getColumnNumber() + " of "
                        + base, e);
            }
            throw new DocumentException("Parse error at line " + e.getLineNumber() + " : " + e.getColumnNumber(), e);
        } catch (SAXException e) {
            // FIXME: throw SAXException from method?
            if (base != null) {
                throw new DocumentException("Sax error while parsing " + base, e);
            }
            throw new DocumentException("Sax error ", e);
        } finally {
            Util.closeSilently(reader);
            profiler.end(handler.getClass());
        }
        timeFinishedLoading = System.currentTimeMillis();
View Full Code Here

                writer.close();
                return resultStream.toString(outputEncoding);
            }
            else
            {
                throw new DocumentException("Payload is not valid XML");
            }
        }
        catch (Exception e)
        {
            throw new TransformerException(this, e);
View Full Code Here

        try {
            SAXReader reader = new SAXReader(newXMLReader(), false);
            reader.setEntityResolver(IGNORING_ENTITY_RESOLVER);
            return reader;
        } catch (SAXException saxe) {
            throw new DocumentException(saxe);
        } catch (ParserConfigurationException pce) {
            throw new DocumentException(pce);
        }
    }
View Full Code Here

  }

  public PentahoXml( Document doc ) throws DocumentException {
    Element rootElement = doc.getRootElement();
    if ( ( rootElement != null ) && !doc.getRootElement().getName().equals( ROOT_ELEMENT ) ) {
      throw new DocumentException( Messages.getInstance().getErrorString( "PentahoXml.ERROR_0001_INVALID_ROOT_ELEMENT" ) ); //$NON-NLS-1$
    }
    document = doc;
  }
View Full Code Here

  }

  public PdiConfigXml( Document doc ) throws DocumentException {
    Element rootElement = doc.getRootElement();
    if ( ( rootElement != null ) && !doc.getRootElement().getName().equals( ROOT_ELEMENT ) ) {
      throw new DocumentException( Messages.getInstance().getErrorString(
          "GoogleMapsConfig.ERROR_0001_INVALID_ROOT_ELEMENT" ) ); //$NON-NLS-1$
    }
    document = doc;
  }
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.