Skip navigation links

Oracle® Database XML Java API Reference 11g Release 2 (11.2) E10769-01

## oracle.xml.util
Class XMLException

`java.lang.Object
java.lang.Throwable
java.lang.Exception
oracle.xml.util.XMLException`

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  XSLException

      public class XMLException

extends java.lang.Exception

Indicates that a parsing exception occurred while processing an XML document

See Also:
  Serialized Form

Field Summary
`static int` `ERROR` Code for non-fatal error
`static int` `FATAL_ERROR` Code for fatal error
`static int` `WARNING` Code for warning

Constructor Summary
`XMLException(java.lang.String mesg, java.lang.String pubId, java.lang.String sysId, int line, int col, int type)`
`XMLException(java.lang.String mesg, java.lang.Throwable ex)`
`XMLException(XMLError err, java.lang.Exception e)`
`XMLException(XMLError err, int firsterr)`
`XMLException(XMLError err, int firsterr, java.lang.Exception e)`

Method Summary
`java.lang.String` `formatErrorMessage(int i)` Get the error message at specified index
`java.lang.Throwable` `getCause()` Get the cause exception
`int` `getColumnNumber(int i)` Get the column number of error at specified index
`java.lang.Exception` `getException(int i)` Get the exception (if exists) that occured in error at specified index
`int` `getLineNumber(int i)` Get the line number of error at specified index
`java.lang.String` `getMessage(int i)` Get the error message at specified index
`int` `getMessageType(int i)` Get the type of the error message at specified index
`int` `getNumMessages()` Return the total number of errors/warnings found during parsing
`java.lang.String` `getPublicId(int i)` Get the public ID of input when error at specified index occured
`java.lang.String` `getSystemId(int i)` Get the system ID of input when error at specified index occured
`XMLError` `getXMLError()` Get XMLError object inside XMLException.
`java.lang.Throwable` `initCause(java.lang.Throwable ex)` Set the underlying exception (if exists) This overrides the super.initCause (since JDK1.4)
`void` `printStackTrace()` Prints this `Throwable` and its backtrace to the standard error stream.
`void` `printStackTrace(java.io.PrintStream s)` Prints this `Throwable` and its backtrace to the specified print stream.
`void` `printStackTrace(java.io.PrintWriter s)` Prints this `Throwable` and its backtrace to the specified print writer.
`void` `setException(java.lang.Exception ex)` Set the underlying exception (if exists)
`java.lang.String` `toString()` Override toString to pick up any embedded exception.

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, setStackTrace`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### ERROR

    public static final int ERROR

  Code for non-fatal error
  See Also:
    Constant Field Values

### FATAL_ERROR

    public static final int FATAL_ERROR

  Code for fatal error
  See Also:
    Constant Field Values

### WARNING

    public static final int WARNING

  Code for warning
  See Also:
    Constant Field Values

Constructor Detail

### XMLException

    public XMLException(java.lang.String mesg,
                        java.lang.Throwable ex)

### XMLException

    public XMLException(java.lang.String mesg,
                        java.lang.String pubId,
                        java.lang.String sysId,
                        int line,
                        int col,
                        int type)

### XMLException

    public XMLException(XMLError err,
                        int firsterr)

### XMLException

    public XMLException(XMLError err,
                        int firsterr,
                        java.lang.Exception e)

### XMLException

    public XMLException(XMLError err,
                        java.lang.Exception e)

Method Detail

### getNumMessages

    public int getNumMessages()

  Return the total number of errors/warnings found during parsing
  Returns:
    The number of errors/warnings

### getMessage

    public java.lang.String getMessage(int i)

  Get the error message at specified index
  Returns:
    The error message

### formatErrorMessage

    public java.lang.String formatErrorMessage(int i)

  Get the error message at specified index
  Returns:
    The error message

### getLineNumber

    public int getLineNumber(int i)

  Get the line number of error at specified index
  Returns:
    The line number

### getColumnNumber

    public int getColumnNumber(int i)

  Get the column number of error at specified index
  Returns:
    The column number

### getSystemId

    public java.lang.String getSystemId(int i)

  Get the system ID of input when error at specified index occured
  Returns:
    The system ID

### getPublicId

    public java.lang.String getPublicId(int i)

  Get the public ID of input when error at specified index occured
  Returns:
    The public ID

### getException

    public java.lang.Exception getException(int i)

  Get the exception (if exists) that occured in error at specified index
  Returns:
    The exception

### getCause

    public java.lang.Throwable getCause()

  Get the cause exception
  Overrides:
    `getCause` in class `java.lang.Throwable`
  Returns:
    The exception

### getMessageType

    public int getMessageType(int i)

  Get the type of the error message at specified index
  Returns:
    The error message type

### printStackTrace

    public void printStackTrace()

  Prints this `Throwable` and its backtrace to the standard error stream.
  Overrides:
    `printStackTrace` in class `java.lang.Throwable`

### printStackTrace

    public void printStackTrace(java.io.PrintStream s)

  Prints this `Throwable` and its backtrace to the specified print stream.
  Overrides:
    `printStackTrace` in class `java.lang.Throwable`

### printStackTrace

    public void printStackTrace(java.io.PrintWriter s)

  Prints this `Throwable` and its backtrace to the specified print writer.
  Overrides:
    `printStackTrace` in class `java.lang.Throwable`

### toString

    public java.lang.String toString()

  Override toString to pick up any embedded exception.
  Overrides:
    `toString` in class `java.lang.Throwable`
  Returns:
    A string representation of this exception.

### setException

    public void setException(java.lang.Exception ex)

  Set the underlying exception (if exists)
  Parameters:
    `The` - exception

### initCause

    public java.lang.Throwable initCause(java.lang.Throwable ex)

  Set the underlying exception (if exists) This overrides the super.initCause (since JDK1.4)
  Overrides:
    `initCause` in class `java.lang.Throwable`
  Parameters:
    `The` - `Throwable cause`
  `Returns:`
    `this`

### getXMLError

    public XMLError getXMLError()

  Get XMLError object inside XMLException.
  Returns:
    the XMLError object.

Skip navigation links

Oracle® Database XML Java API Reference 11g Release 2 (11.2) E10769-01

Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.