Package net.n3.nanoxml
Class XMLException
java.lang.Object
java.lang.Throwable
java.lang.Exception
net.n3.nanoxml.XMLException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
XMLParseException
,XMLValidationException
An XMLException is thrown when an exception occurred while processing the
XML data.
- Version:
- $Name: RELEASE_2_2_1 $, $Revision: 1.4 $
- Author:
- Marc De Scheemaecker
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new exception.XMLException
(String msg) Creates a new exception.XMLException
(String systemID, int lineNr, Exception e) Creates a new exception.XMLException
(String systemID, int lineNr, Exception e, String msg, boolean reportParams) Creates a new exception.XMLException
(String systemID, int lineNr, String msg) Creates a new exception. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
finalize()
Cleans up the object when it's destroyed.Returns the encapsulated exception, or null if no exception is encapsulated.int
Returns the line number in the XML data where the exception occurred.Returns the system ID of the XML data where the exception occurred.void
Dumps the exception stack to System.err.void
printStackTrace
(PrintStream stream) Dumps the exception stack to an output stream.void
printStackTrace
(PrintWriter writer) Dumps the exception stack to a print writer.toString()
Returns a string representation of the exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace
-
Constructor Details
-
XMLException
Creates a new exception.- Parameters:
msg
- the message of the exception.
-
XMLException
Creates a new exception.- Parameters:
e
- the encapsulated exception.
-
XMLException
Creates a new exception.- Parameters:
systemID
- the system ID of the XML data where the exception occurredlineNr
- the line number in the XML data where the exception occurred.e
- the encapsulated exception.
-
XMLException
Creates a new exception.- Parameters:
systemID
- the system ID of the XML data where the exception occurredlineNr
- the line number in the XML data where the exception occurred.msg
- the message of the exception.
-
XMLException
Creates a new exception.- Parameters:
systemID
- the system ID from where the data camelineNr
- the line number in the XML data where the exception occurred.e
- the encapsulated exception.msg
- the message of the exception.reportParams
- true if the systemID, lineNr and e params need to be appended to the message
-
-
Method Details
-
finalize
Cleans up the object when it's destroyed. -
getSystemID
Returns the system ID of the XML data where the exception occurred. If there is no system ID known, null is returned. -
getLineNr
public int getLineNr()Returns the line number in the XML data where the exception occurred. If there is no line number known, -1 is returned. -
getException
Returns the encapsulated exception, or null if no exception is encapsulated. -
printStackTrace
Dumps the exception stack to a print writer.- Overrides:
printStackTrace
in classThrowable
- Parameters:
writer
- the print writer
-
printStackTrace
Dumps the exception stack to an output stream.- Overrides:
printStackTrace
in classThrowable
- Parameters:
stream
- the output stream
-
printStackTrace
public void printStackTrace()Dumps the exception stack to System.err.- Overrides:
printStackTrace
in classThrowable
-
toString
Returns a string representation of the exception.
-