Repository navigation
Expand file tree
/
Copy pathPrinterIOException.java
More file actions
88 lines (82 loc) · 2.2 KB
/
Copy pathPrinterIOException.java
File metadata and controls
88 lines (82 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
* Copyright 1998-2000 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.awt.print;
import java.io.IOException;
/**
* The <code>PrinterIOException</code> class is a subclass of
* {@link PrinterException} and is used to indicate that an IO error
* of some sort has occurred while printing.
*
* <p>As of release 1.4, this exception has been retrofitted to conform to
* the general purpose exception-chaining mechanism. The
* "<code>IOException</code> that terminated the print job"
* that is provided at construction time and accessed via the
* {@link #getIOException()} method is now known as the <i>cause</i>,
* and may be accessed via the {@link Throwable#getCause()} method,
* as well as the aforementioned "legacy method."
*/
public class PrinterIOException extends PrinterException {
static final long serialVersionUID = 5850870712125932846L;
/**
* The IO error that terminated the print job.
* @serial
*/
private IOException mException;
/**
* Constructs a new <code>PrinterIOException</code>
* with the string representation of the specified
* {@link IOException}.
* @param exception the specified <code>IOException</code>
*/
public PrinterIOException(IOException exception) {
initCause(null); // Disallow subsequent initCause
mException = exception;
}
/**
* Returns the <code>IOException</code> that terminated
* the print job.
*
* <p>This method predates the general-purpose exception chaining facility.
* The {@link Throwable#getCause()} method is now the preferred means of
* obtaining this information.
*
* @return the <code>IOException</code> that terminated
* the print job.
* @see IOException
*/
public IOException getIOException() {
return mException;
}
/**
* Returns the the cause of this exception (the <code>IOException</code>
* that terminated the print job).
*
* @return the cause of this exception.
* @since 1.4
*/
public Throwable getCause() {
return mException;
}
}