1 |
/* PrinterIOException.java -- The print job encountered an I/O error |
/* PrinterIOException.java -- The print job encountered an I/O error |
2 |
Copyright (C) 1999 Free Software Foundation, Inc. |
Copyright (C) 1999, 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
38 |
|
|
39 |
package java.awt.print; |
package java.awt.print; |
40 |
|
|
|
import java.io.Serializable; |
|
41 |
import java.io.IOException; |
import java.io.IOException; |
42 |
|
|
43 |
/** |
/** |
44 |
* This exception is thrown when the print job encounters an I/O problem |
* This exception is thrown when the print job encounters an I/O problem |
45 |
* of some kind. |
* of some kind. |
46 |
* |
* |
47 |
* @author Aaron M. Renn (arenn@urbanophile.com) |
* @author Aaron M. Renn <arenn@urbanophile.com> |
48 |
*/ |
* @author Eric Blake <ebb9@email.byu.edu> |
49 |
public class PrinterIOException extends PrinterException |
* @status updated to 1.4 |
|
implements Serializable |
|
|
{ |
|
|
|
|
|
/* |
|
|
* Instance Variables |
|
50 |
*/ |
*/ |
51 |
|
public class PrinterIOException extends PrinterException |
|
/** |
|
|
* @serial The <code>IOException</code> that lead to this |
|
|
* exception being thrown. |
|
|
*/ |
|
|
private IOException mException; |
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/* |
|
|
* Constructors |
|
|
*/ |
|
|
|
|
|
/** |
|
|
* Initializes a new instance of <code>PrinterIOException</code> with the |
|
|
* text description of the specified <code>IOException</code>. |
|
|
* |
|
|
* @param mException The <code>IOException</code> that caused this |
|
|
* exception to be thrown. |
|
|
*/ |
|
|
public |
|
|
PrinterIOException(IOException mException) |
|
52 |
{ |
{ |
53 |
this(mException.toString()); |
/** |
54 |
this.mException = mException; |
* Compatible with JDK 1.2+. |
55 |
} |
*/ |
56 |
|
private static final long serialVersionUID = 5850870712125932846L; |
57 |
/*************************************************************************/ |
|
58 |
|
/** |
59 |
/** |
* The exception that caused this (duplicates Throwable). |
60 |
* Initializes a new instance of <code>PrinterIOException</code> with a |
* |
61 |
* descriptive error message. Note that this constructor is private. |
* @serial the I/O exception that terminated the job |
|
* |
|
|
* @param message The descriptive error message. |
|
62 |
*/ |
*/ |
63 |
private |
private final IOException mException; |
|
PrinterIOException(String message) |
|
|
{ |
|
|
super(message); |
|
|
} |
|
|
|
|
|
/*************************************************************************/ |
|
64 |
|
|
65 |
/* |
/** |
66 |
* Instance Methods |
* Initializes a new instance with the given cause. |
67 |
*/ |
* |
68 |
|
* @param mException the cause |
69 |
/** |
*/ |
70 |
* This method returns the underlying <code>IOException</code> that |
public PrinterIOException(IOException mException) |
71 |
* caused this exception. |
{ |
72 |
* |
super(mException == null ? null : mException.toString()); |
73 |
* @return The <code>IOException</code> that caused this exception. |
initCause(mException); |
74 |
|
this.mException = mException; |
75 |
|
} |
76 |
|
|
77 |
|
/** |
78 |
|
* Gets the underlying <code>IOException</code> that caused this exception. |
79 |
|
* This legacy method has been replaced by {@link #getCause()}. |
80 |
|
* |
81 |
|
* @return the cause |
82 |
*/ |
*/ |
83 |
public IOException |
public IOException getIOException() |
84 |
getIOException() |
{ |
85 |
{ |
return mException; |
86 |
return(mException); |
} |
87 |
} |
|
88 |
|
/** |
89 |
|
* Gets the cause. |
90 |
|
* |
91 |
|
* @return the cause |
92 |
|
*/ |
93 |
|
public Throwable getCause() |
94 |
|
{ |
95 |
|
return mException; |
96 |
|
} |
97 |
} // class PrinterIOException |
} // class PrinterIOException |
98 |
|
|