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
public class DocumentException extends Exception
Signals that an error has occurred in aDocument.- See Also:
BadElementException,Document,DocWriter,DocListener, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DocumentException()Constructs aDocumentExceptionwhithout a message.DocumentException(Exception ex)Creates a Document exception.DocumentException(String message)Constructs aDocumentExceptionwith a message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetLocalizedMessage()and make sure we also produce a localized versionStringgetMessage()We print the message of the checked exceptionvoidprintStackTrace()we have to override this as wellvoidprintStackTrace(PrintStream s)here we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"voidprintStackTrace(PrintWriter s)Again, we prefix the stack trace with "ExceptionConverter:"StringtoString()The toString() is changed to be prefixed with ExceptionConverter-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, setStackTrace
-
-
-
-
Constructor Detail
-
DocumentException
public DocumentException(Exception ex)
Creates a Document exception.- Parameters:
ex- an exception that has to be turned into a DocumentException
-
DocumentException
public DocumentException()
Constructs aDocumentExceptionwhithout a message.
-
DocumentException
public DocumentException(String message)
Constructs aDocumentExceptionwith a message.- Parameters:
message- a message describing the exception
-
-
Method Detail
-
getMessage
public String getMessage()
We print the message of the checked exception- Overrides:
getMessagein classThrowable- Returns:
- the error message
-
getLocalizedMessage
public String getLocalizedMessage()
and make sure we also produce a localized version- Overrides:
getLocalizedMessagein classThrowable- Returns:
- a localized message
-
toString
public String toString()
The toString() is changed to be prefixed with ExceptionConverter
-
printStackTrace
public void printStackTrace()
we have to override this as well- Overrides:
printStackTracein classThrowable
-
printStackTrace
public void printStackTrace(PrintStream s)
here we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"- Overrides:
printStackTracein classThrowable- Parameters:
s- a printstream object
-
printStackTrace
public void printStackTrace(PrintWriter s)
Again, we prefix the stack trace with "ExceptionConverter:"- Overrides:
printStackTracein classThrowable- Parameters:
s- A PrintWriter object
-
-