Class DocumentException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.gitlab.pdftk_java.com.lowagie.text.DocumentException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
BadElementException
,PdfException
public class DocumentException extends java.lang.Exception
Signals that an error has occurred in aDocument
.- See Also:
BadElementException
,Document
,DocWriter
,DocListener
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Exception
ex
private static long
serialVersionUID
A serial version UID
-
Constructor Summary
Constructors Constructor Description DocumentException()
Constructs aDocumentException
whithout a message.DocumentException(java.lang.Exception ex)
Creates a Document exception.DocumentException(java.lang.String message)
Constructs aDocumentException
with a message.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getLocalizedMessage()
and make sure we also produce a localized versionjava.lang.String
getMessage()
We print the message of the checked exceptionvoid
printStackTrace()
we have to override this as wellvoid
printStackTrace(java.io.PrintStream s)
here we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"void
printStackTrace(java.io.PrintWriter s)
Again, we prefix the stack trace with "ExceptionConverter:"private static java.lang.String
split(java.lang.String s)
Removes everything in a String that comes before a '.'java.lang.String
toString()
The toString() is changed to be prefixed with ExceptionConverter
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
A serial version UID- See Also:
- Constant Field Values
-
ex
private java.lang.Exception ex
-
-
Constructor Detail
-
DocumentException
public DocumentException(java.lang.Exception ex)
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
public DocumentException(java.lang.String message)
Constructs aDocumentException
with a message.- Parameters:
message
- a message describing the exception
-
-
Method Detail
-
getMessage
public java.lang.String getMessage()
We print the message of the checked exception- Overrides:
getMessage
in classjava.lang.Throwable
- Returns:
- the error message
-
getLocalizedMessage
public java.lang.String getLocalizedMessage()
and make sure we also produce a localized version- Overrides:
getLocalizedMessage
in classjava.lang.Throwable
- Returns:
- a localized message
-
toString
public java.lang.String toString()
The toString() is changed to be prefixed with ExceptionConverter- Overrides:
toString
in classjava.lang.Throwable
- Returns:
- the String version of the exception
-
printStackTrace
public void printStackTrace()
we have to override this as well- Overrides:
printStackTrace
in classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintStream s)
here we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"- Overrides:
printStackTrace
in classjava.lang.Throwable
- Parameters:
s
- a printstream object
-
printStackTrace
public void printStackTrace(java.io.PrintWriter s)
Again, we prefix the stack trace with "ExceptionConverter:"- Overrides:
printStackTrace
in classjava.lang.Throwable
- Parameters:
s
- A PrintWriter object
-
split
private static java.lang.String split(java.lang.String s)
Removes everything in a String that comes before a '.'- Parameters:
s
- the original string- Returns:
- the part that comes after the dot
-
-