Class DocumentException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.gitlab.pdftk_java.com.lowagie.text.DocumentException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BadElementException, PdfException
Signals that an error has occurred in a
Document.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Exceptionprivate static final longA serial version UID -
Constructor Summary
ConstructorsConstructorDescriptionConstructs aDocumentExceptionwhithout a message.Creates a Document exception.DocumentException(String message) Constructs aDocumentExceptionwith a message. -
Method Summary
Modifier and TypeMethodDescriptionand make sure we also produce a localized versionWe print the message of the checked exceptionvoidwe have to override this as wellvoidhere we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"voidAgain, we prefix the stack trace with "ExceptionConverter:"private static StringRemoves everything in a String that comes before a '.'toString()The toString() is changed to be prefixed with ExceptionConverterMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, setStackTrace
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDA serial version UID- See Also:
-
ex
-
-
Constructor Details
-
DocumentException
Creates a Document exception.- Parameters:
ex- an exception that has to be turned into a DocumentException
-
DocumentException
public DocumentException()Constructs aDocumentExceptionwhithout a message. -
DocumentException
Constructs aDocumentExceptionwith a message.- Parameters:
message- a message describing the exception
-
-
Method Details
-
getMessage
We print the message of the checked exception- Overrides:
getMessagein classThrowable- Returns:
- the error message
-
getLocalizedMessage
and make sure we also produce a localized version- Overrides:
getLocalizedMessagein classThrowable- Returns:
- a localized message
-
toString
-
printStackTrace
public void printStackTrace()we have to override this as well- Overrides:
printStackTracein classThrowable
-
printStackTrace
here we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"- Overrides:
printStackTracein classThrowable- Parameters:
s- a printstream object
-
printStackTrace
Again, we prefix the stack trace with "ExceptionConverter:"- Overrides:
printStackTracein classThrowable- Parameters:
s- A PrintWriter object
-
split
-