Package org.apache.batik.xml
Class XMLException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.apache.batik.xml.XMLException
-
- All Implemented Interfaces:
java.io.Serializable
public class XMLException extends java.lang.RuntimeExceptionThis 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.
- Version:
- $Id: XMLException.java 1733416 2016-03-03 07:07:13Z gadams $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Exceptionexception
-
Constructor Summary
Constructors Constructor Description XMLException(java.lang.Exception e)Creates a new XMLException wrapping an existing exception.XMLException(java.lang.String message)Creates a new XMLException.XMLException(java.lang.String message, java.lang.Exception e)Creates a new XMLException from an existing exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ExceptiongetException()Return the embedded exception, if any.java.lang.StringgetMessage()Return a detail message for this exception.voidprintStackTrace()Prints thisExceptionand its backtrace to the standard error stream.voidprintStackTrace(java.io.PrintStream s)Prints thisExceptionand its backtrace to the specified print stream.voidprintStackTrace(java.io.PrintWriter s)Prints thisExceptionand its backtrace to the specified print writer.
-
-
-
Constructor Detail
-
XMLException
public XMLException(java.lang.String message)
Creates a new XMLException.- Parameters:
message- The error or warning message.
-
XMLException
public XMLException(java.lang.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(java.lang.String message, java.lang.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 java.lang.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:
getMessagein classjava.lang.Throwable- Returns:
- The error or warning message.
-
getException
public java.lang.Exception getException()
Return the embedded exception, if any.- Returns:
- The embedded exception, or null if there is none.
-
printStackTrace
public void printStackTrace()
Prints thisExceptionand its backtrace to the standard error stream.- Overrides:
printStackTracein classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintStream s)
Prints thisExceptionand its backtrace to the specified print stream.- Overrides:
printStackTracein classjava.lang.Throwable- Parameters:
s-PrintStreamto use for output
-
printStackTrace
public void printStackTrace(java.io.PrintWriter s)
Prints thisExceptionand its backtrace to the specified print writer.- Overrides:
printStackTracein classjava.lang.Throwable- Parameters:
s-PrintWriterto use for output
-
-