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 Exception
private static final long
A serial version UID -
Constructor Summary
ConstructorsConstructorDescriptionConstructs aDocumentException
whithout a message.Creates a Document exception.DocumentException
(String message) Constructs aDocumentException
with a message. -
Method Summary
Modifier and TypeMethodDescriptionand make sure we also produce a localized versionWe print the message of the checked exceptionvoid
we have to override this as wellvoid
here we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"void
Again, we prefix the stack trace with "ExceptionConverter:"private static String
Removes everything in a String that comes before a '.'toString()
The toString() is changed to be prefixed with ExceptionConverterMethods inherited from class java.lang.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 aDocumentException
whithout a message. -
DocumentException
Constructs aDocumentException
with a message.- Parameters:
message
- a message describing the exception
-
-
Method Details
-
getMessage
We print the message of the checked exception- Overrides:
getMessage
in classThrowable
- Returns:
- the error message
-
getLocalizedMessage
and make sure we also produce a localized version- Overrides:
getLocalizedMessage
in classThrowable
- Returns:
- a localized message
-
toString
The toString() is changed to be prefixed with ExceptionConverter -
printStackTrace
public void printStackTrace()we have to override this as well- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
here we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"- Overrides:
printStackTrace
in classThrowable
- Parameters:
s
- a printstream object
-
printStackTrace
Again, we prefix the stack trace with "ExceptionConverter:"- Overrides:
printStackTrace
in classThrowable
- Parameters:
s
- A PrintWriter object
-
split
Removes everything in a String that comes before a '.'- Parameters:
s
- the original string- Returns:
- the part that comes after the dot
-