org.apache.xerces.xni
Class XNIException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.apache.xerces.xni.XNIException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
XMLConfigurationException, XMLParseException

public class XNIException
extends RuntimeException

This exception is the base exception of all XNI exceptions. It can be constructed with an error message or used to wrap another exception object.

Note: By extending the Java RuntimeException, XNI handlers and components are not required to catch XNI exceptions but may explicitly catch them, if so desired.

Version:
$Id: XNIException.java 766579 2009-04-20 05:31:56Z mrglavas $
Author:
Andy Clark, IBM
See Also:
Serialized Form

Constructor Summary
XNIException(Exception exception)
          Constructs an XNI exception with a wrapped exception.
XNIException(String message)
          Constructs an XNI exception with a message.
XNIException(String message, Exception exception)
          Constructs an XNI exception with a message and wrapped exception.
 
Method Summary
 Throwable getCause()
          Returns the cause of this XNIException.
 Exception getException()
          Returns the wrapped exception.
 Throwable initCause(Throwable throwable)
          Initializes the cause of this XNIException.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XNIException

public XNIException(String message)
Constructs an XNI exception with a message.

Parameters:
message - The exception message.

XNIException

public XNIException(Exception exception)
Constructs an XNI exception with a wrapped exception.

Parameters:
exception - The wrapped exception.

XNIException

public XNIException(String message,
                    Exception exception)
Constructs an XNI exception with a message and wrapped exception.

Parameters:
message - The exception message.
exception - The wrapped exception.
Method Detail

getException

public Exception getException()
Returns the wrapped exception.


initCause

public Throwable initCause(Throwable throwable)
Initializes the cause of this XNIException. The value must be an instance of Exception or null.

Overrides:
initCause in class Throwable
Parameters:
throwable - the cause
Returns:
this exception
Throws:
IllegalStateException - if a cause has already been set
IllegalArgumentException - if the cause is this exception
ClassCastException - if the cause is not assignable to Exception

getCause

public Throwable getCause()
Returns the cause of this XNIException.

Overrides:
getCause in class Throwable


Copyright © 2011. All Rights Reserved.