congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
DocumentException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.dom4j.DocumentException
constructor

Best Java code snippets using org.dom4j.DocumentException.<init> (Showing top 20 results out of 315)

origin: com.thoughtworks.xstream/xstream

  /**
   * Create and initialize the SAX reader.
   * 
   * @return the SAX reader instance.
   * @throws DocumentException if DOCTYPE processing cannot be disabled
   * @since 1.4.9
   */
  protected SAXReader createReader() throws DocumentException {
    final SAXReader reader = new SAXReader();
    try {
      reader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
    } catch (SAXException e) {
      throw new DocumentException("Cannot disable DOCTYPE processing", e);
    }
    return reader;
  }
}
origin: spotbugs/spotbugs

public void readXML(URL u) throws IOException, DocumentException {
  InputStream in = progessMonitoredInputStream(u.openConnection(), "Loading analysis");
  dataSource = u.toString();
  try {
    readXML(in);
  } catch (IOException e) {
    throw newIOException(u, e);
  } catch (DocumentException e) {
    throw new DocumentException("Failing reading " + u, e);
  }
}
origin: spotbugs/spotbugs

  } catch (SAXException e) {
    AnalysisContext.logError("Couldn't create XMLReaderFactory", e);
    throw new DocumentException("Sax error ", e);
} 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) {
    throw new DocumentException("Sax error while parsing " + base, e);
  throw new DocumentException("Sax error ", e);
} finally {
  Util.closeSilently(reader);
origin: spotbugs/spotbugs

/**
 * Read XML data from given file into this object, populating given Project
 * as a side effect.
 *
 * @param file
 *            the file
 */
public void readXML(File file) throws IOException, DocumentException {
  project.setCurrentWorkingDirectory(file.getParentFile());
  dataSource = file.getAbsolutePath();
  InputStream in = progessMonitoredInputStream(file, "Loading analysis");
  try {
    readXML(in, file);
  } catch (IOException e) {
    throw newIOException(file, e);
  } catch (DocumentException e) {
    throw new DocumentException("Failing reading " + file, e);
  }
}
origin: spotbugs/spotbugs

DocumentException e2 = new DocumentException("Error parsing " + newFilename);
e2.initCause(e);
if (verbose) {
origin: igniterealtime/Openfire

throw new DocumentException("Cannot have text content outside of the root document");
throw new DocumentException("Cannot have an entityref outside of the root document");
throw new DocumentException("Cannot have text content outside of the root document");
origin: org.dom4j/dom4j

/**
 * Sets the DOM {@link org.w3c.dom.Document}implementation class name used
 * by the writer when creating DOM documents.
 * 
 * @param name
 *            is the name of the Class implementing the {@link
 *            org.w3c.dom.Document} interface
 * 
 * @throws DocumentException
 *             if the class could not be loaded
 */
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);
  }
}
origin: org.dom4j/dom4j

/**
 * Parses the specified {@link java.io.InputStream}
 * 
 * @param source
 *            the input stream to parse
 * 
 * @return the resulting DOM4J document
 * 
 * @throws DocumentException
 *             when an error occurs while parsing
 */
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);
  }
}
origin: org.dom4j/dom4j

/**
 * Parses the the given URL or filename.
 * 
 * @param source
 *            the location to parse
 * 
 * @return the resulting DOM4J document
 * 
 * @throws DocumentException
 *             when an error occurs while parsing
 */
public Document read(String source) throws DocumentException {
  try {
    return getReader().read(source);
  } catch (JAXBRuntimeException ex) {
    Throwable cause = ex.getCause();
    throw new DocumentException(cause.getMessage(), cause);
  }
}
origin: org.dom4j/dom4j

/**
 * Parses the specified {@link java.io.Reader}
 * 
 * @param source
 *            the input reader to use
 * 
 * @return the resulting DOM4J document
 * 
 * @throws DocumentException
 *             when an error occurs while parsing
 */
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);
  }
}
origin: org.dom4j/dom4j

/**
 * Parses the specified {@link org.xml.sax.InputSource}
 * 
 * @param source
 *            the source to parse
 * 
 * @return the resulting DOM4J document
 * 
 * @throws DocumentException
 *             when an error occurs while parsing
 */
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);
  }
}
origin: org.dom4j/dom4j

/**
 * Parses the the given URL.
 * 
 * @param source
 *            the URL to parse
 * 
 * @return the resulting DOM4J document
 * 
 * @throws DocumentException
 *             when an error occurs while parsing
 */
public Document read(URL source) throws DocumentException {
  try {
    return getReader().read(source);
  } catch (JAXBRuntimeException ex) {
    Throwable cause = ex.getCause();
    throw new DocumentException(cause.getMessage(), cause);
  }
}
origin: org.dom4j/dom4j

/**
 * Reads a Document from the given {@link java.io.Reader}and writes it to
 * the specified {@link XMLWriter}using SAX. Registered {@link
 * ElementModifier} objects are invoked on the fly.
 * 
 * @param source
 *            is the <code>java.io.Reader</code> to read from.
 * 
 * @return the newly created Document instance
 * 
 * @throws DocumentException
 *             DocumentException org.dom4j.DocumentException} if an error
 *             occurs during parsing.
 */
public Document modify(Reader source) throws DocumentException {
  try {
    return installModifyReader().read(source);
  } catch (SAXModifyException ex) {
    Throwable cause = ex.getCause();
    throw new DocumentException(cause.getMessage(), cause);
  }
}
origin: org.dom4j/dom4j

/**
 * Reads a Document from the given {@link java.net.URL}and writes it to the
 * specified {@link XMLWriter}using SAX. Registered {@link ElementModifier}
 * objects are invoked on the fly.
 * 
 * @param source
 *            is the <code>java.net.URL</code> to read from.
 * 
 * @return the newly created Document instance
 * 
 * @throws DocumentException
 *             DocumentException org.dom4j.DocumentException} if an error
 *             occurs during parsing.
 */
public Document modify(URL source) throws DocumentException {
  try {
    return installModifyReader().read(source);
  } catch (SAXModifyException ex) {
    Throwable cause = ex.getCause();
    throw new DocumentException(cause.getMessage(), cause);
  }
}
origin: org.dom4j/dom4j

/**
 * Reads a Document from the given {@link org.xml.sax.InputSource}and
 * writes it to the specified {@link XMLWriter}using SAX. Registered
 * {@link ElementModifier}objects are invoked on the fly.
 * 
 * @param source
 *            is the <code>org.xml.sax.InputSource</code> to read from.
 * 
 * @return the newly created Document instance
 * 
 * @throws DocumentException
 *             DocumentException org.dom4j.DocumentException} if an error
 *             occurs during parsing.
 */
public Document modify(InputSource source) throws DocumentException {
  try {
    return installModifyReader().read(source);
  } catch (SAXModifyException ex) {
    Throwable cause = ex.getCause();
    throw new DocumentException(cause.getMessage(), cause);
  }
}
origin: org.dom4j/dom4j

/**
 * Reads a Document from the given {@link java.io.InputStream}and writes it
 * to the specified {@link XMLWriter}using SAX. Registered {@link
 * ElementModifier} objects are invoked on the fly.
 * 
 * @param source
 *            is the <code>java.io.InputStream</code> to read from.
 * 
 * @return the newly created Document instance
 * 
 * @throws DocumentException
 *             DocumentException org.dom4j.DocumentException} if an error
 *             occurs during parsing.
 */
public Document modify(InputStream source) throws DocumentException {
  try {
    return installModifyReader().read(source);
  } catch (SAXModifyException ex) {
    Throwable cause = ex.getCause();
    throw new DocumentException(cause.getMessage(), cause);
  }
}
origin: org.dom4j/dom4j

/**
 * Parses the specified {@link java.io.Reader}
 * 
 * @param source
 *            the input reader to parse
 * @param systemId
 *            is the URI for the input
 * 
 * @return the resulting DOM4J document
 * 
 * @throws DocumentException
 *             when an error occurs while parsing
 */
public Document read(Reader source, String systemId)
    throws DocumentException {
  try {
    return getReader().read(source);
  } catch (JAXBRuntimeException ex) {
    Throwable cause = ex.getCause();
    throw new DocumentException(cause.getMessage(), cause);
  }
}
origin: org.dom4j/dom4j

/**
 * Parses the the given URL or filename.
 * 
 * @param url
 *            the URL or filename to parse
 * 
 * @return the resulting DOM4J document
 * 
 * @throws DocumentException
 *             when an error occurs while parsing
 * @throws IOException
 *             when an error occurs while writing to the {@link
 *             org.dom4j.io.XMLWriter}
 */
public Document modify(String url) throws DocumentException, IOException {
  try {
    return installModifier().modify(url);
  } catch (JAXBRuntimeException ex) {
    Throwable cause = ex.getCause();
    throw new DocumentException(cause.getMessage(), cause);
  }
}
origin: org.dom4j/dom4j

/**
 * Parses the the given URL.
 * 
 * @param source
 *            the URL to parse
 * 
 * @return the resulting DOM4J document
 * 
 * @throws DocumentException
 *             when an error occurs while parsing
 * @throws IOException
 *             when an error occurs while writing to the {@link
 *             org.dom4j.io.XMLWriter}
 */
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);
  }
}
origin: org.dom4j/dom4j

private SAXReader installModifyReader() throws DocumentException {
  try {
    SAXModifyReader reader = getSAXModifyReader();
    if (isPruneElements()) {
      modifyReader.setDispatchHandler(new PruningDispatchHandler());
    }
    reader.resetHandlers();
    for (Map.Entry<String, ElementModifier> entry : this.modifiers.entrySet()) {
      SAXModifyElementHandler handler = new SAXModifyElementHandler(
          entry.getValue());
      reader.addHandler(entry.getKey(), handler);
    }
    reader.setXMLWriter(getXMLWriter());
    reader.setXMLReader(getXMLReader());
    return reader;
  } catch (SAXException ex) {
    throw new DocumentException(ex.getMessage(), ex);
  }
}
org.dom4jDocumentException<init>

Popular methods of DocumentException

  • printStackTrace
  • getMessage
  • getNestedException
  • getStackTrace
  • initCause
  • getCause
  • toString

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now