📄 exceptionconverter.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Wed Nov 20 13:00:39 CET 2002 -->
<TITLE>
ExceptionConverter
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="ExceptionConverter";
}
</SCRIPT>
<BODY BGCOLOR="white" onload="asd();">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../com/lowagie/text/DocumentException.html"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="ExceptionConverter.html" TARGET="_top"><B>NO FRAMES</B></A>
<SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.lowagie.text</FONT>
<BR>
Class ExceptionConverter</H2>
<PRE>
<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">java.lang.Object</A>
|
+--<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Throwable.html">java.lang.Throwable</A>
|
+--<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html">java.lang.Exception</A>
|
+--<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/RuntimeException.html">java.lang.RuntimeException</A>
|
+--<B>com.lowagie.text.ExceptionConverter</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/Serializable.html">Serializable</A></DD>
</DL>
<HR>
<DL>
<DT>public class <B>ExceptionConverter</B><DT>extends <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/RuntimeException.html">RuntimeException</A></DL>
<P>
The ExceptionConverter changes a checked exception into an unchecked exception.
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../serialized-form.html" TARGET="com.lowagie.text.ExceptionConverter">Serialized Form</A></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html">Exception</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/lowagie/text/ExceptionConverter.html#ex">ex</A></B></CODE>
<BR>
we keep a handle to the wrapped exception</TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_java.lang.RuntimeException"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/RuntimeException.html">RuntimeException</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE></CODE></TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_java.lang.Throwable"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Throwable.html">Throwable</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE></CODE></TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../com/lowagie/text/ExceptionConverter.html#ExceptionConverter(java.lang.Exception)">ExceptionConverter</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html">Exception</A> ex)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Throwable.html">Throwable</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/lowagie/text/ExceptionConverter.html#fillInStackTrace()">fillInStackTrace</A></B>()</CODE>
<BR>
requests to fill in the stack trace we will have to ignore. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html">Exception</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/lowagie/text/ExceptionConverter.html#getException()">getException</A></B>()</CODE>
<BR>
and allow the user of ExceptionConverter to get a handle to it.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/lowagie/text/ExceptionConverter.html#getLocalizedMessage()">getLocalizedMessage</A></B>()</CODE>
<BR>
and make sure we also produce a localized version</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/lowagie/text/ExceptionConverter.html#getMessage()">getMessage</A></B>()</CODE>
<BR>
We print the message of the checked exception</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/lowagie/text/ExceptionConverter.html#printStackTrace()">printStackTrace</A></B>()</CODE>
<BR>
we have to override this as well</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/lowagie/text/ExceptionConverter.html#printStackTrace(java.io.PrintStream)">printStackTrace</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/PrintStream.html">PrintStream</A> s)</CODE>
<BR>
here we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/lowagie/text/ExceptionConverter.html#printStackTrace(java.io.PrintWriter)">printStackTrace</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/PrintWriter.html">PrintWriter</A> s)</CODE>
<BR>
Again, we prefix the stack trace with "ExceptionConverter:"</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/lowagie/text/ExceptionConverter.html#toString()">toString</A></B>()</CODE>
<BR>
The toString() is changed to be prefixed with ExceptionConverter</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Throwable"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Throwable.html">Throwable</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Throwable.html#getCause()">getCause</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Throwable.html#getStackTrace()">getStackTrace</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Throwable.html#initCause(java.lang.Throwable)">initCause</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[])">setStackTrace</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -