org.apache.batik.xml
Class XMLException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.apache.batik.xml.XMLException
All Implemented Interfaces:
Serializable

public class XMLException
extends RuntimeException

This class encapsulates a general XML error or warning.

This class can contain basic error or warning information from either the parser or the application.

If the application needs to pass through other types of exceptions, it must wrap those exceptions in a XMLException.

See Also:
Serialized Form

Field Summary
protected  Exception exception
           
 
Constructor Summary
XMLException(Exception e)
          Creates a new XMLException wrapping an existing exception.
XMLException(String message)
          Creates a new XMLException.
XMLException(String message, Exception e)
          Creates a new XMLException from an existing exception.
 
Method Summary
 Exception getException()
          Return the embedded exception, if any.
 String getMessage()
          Return a detail message for this exception.
 void printStackTrace()
          Prints this Exception and its backtrace to the standard error stream.
 void printStackTrace(PrintStream s)
          Prints this Exception and its backtrace to the specified print stream.
 void printStackTrace(PrintWriter s)
          Prints this Exception and its backtrace to the specified print writer.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

exception

protected Exception exception
Constructor Detail

XMLException

public XMLException(String message)
Creates a new XMLException.

Parameters:
message - The error or warning message.

XMLException

public XMLException(Exception e)
Creates a new XMLException wrapping an existing exception.

The existing exception will be embedded in the new one, and its message will become the default message for the XMLException.

Parameters:
e - The exception to be wrapped in a XMLException.

XMLException

public XMLException(String message,
                    Exception e)
Creates a new XMLException from an existing exception.

The existing exception will be embedded in the new one, but the new exception will have its own message.

Parameters:
message - The detail message.
e - The exception to be wrapped in a SAXException.
Method Detail

getMessage

public String getMessage()
Return a detail message for this exception.

If there is a embedded exception, and if the XMLException has no detail message of its own, this method will return the detail message from the embedded exception.

Overrides:
getMessage in class Throwable
Returns:
The error or warning message.

getException

public Exception getException()
Return the embedded exception, if any.

Returns:
The embedded exception, or null if there is none.

printStackTrace

public void printStackTrace()
Prints this Exception and its backtrace to the standard error stream.

Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream s)
Prints this Exception and its backtrace to the specified print stream.

Overrides:
printStackTrace in class Throwable
Parameters:
s - PrintStream to use for output

printStackTrace

public void printStackTrace(PrintWriter s)
Prints this Exception and its backtrace to the specified print writer.

Overrides:
printStackTrace in class Throwable
Parameters:
s - PrintWriter to use for output


Copyright © 2008 Apache Software Foundation. All Rights Reserved.