author | alanb |
Fri, 07 Apr 2017 08:05:54 +0000 | |
changeset 44545 | 83b611b88ac8 |
parent 35667 | ed476aba94de |
permissions | -rw-r--r-- |
2 | 1 |
/* |
22657
654c573cb341
8033616: Fix serial lint warnings in javax.imageio.*
darcy
parents:
5506
diff
changeset
|
2 |
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package javax.imageio.metadata; |
|
27 |
||
28 |
import javax.imageio.IIOException; |
|
29 |
import org.w3c.dom.Node; |
|
30 |
||
31 |
/** |
|
35667 | 32 |
* An {@code IIOInvalidTreeException} is thrown when an attempt |
33 |
* by an {@code IIOMetadata} object to parse a tree of |
|
34 |
* {@code IIOMetadataNode}s fails. The node that led to the |
|
2 | 35 |
* parsing error may be stored. As with any parsing error, the actual |
36 |
* error may occur at a different point that that where it is |
|
35667 | 37 |
* detected. The node returned by {@code getOffendingNode} |
2 | 38 |
* should merely be considered as a clue to the actual nature of the |
39 |
* problem. |
|
40 |
* |
|
41 |
* @see IIOMetadata#setFromTree |
|
42 |
* @see IIOMetadata#mergeTree |
|
43 |
* @see IIOMetadataNode |
|
44 |
* |
|
45 |
*/ |
|
46 |
public class IIOInvalidTreeException extends IIOException { |
|
22657
654c573cb341
8033616: Fix serial lint warnings in javax.imageio.*
darcy
parents:
5506
diff
changeset
|
47 |
private static final long serialVersionUID = -1314083172544132777L; |
2 | 48 |
|
49 |
/** |
|
35667 | 50 |
* The {@code Node} that led to the parsing error, or |
51 |
* {@code null}. |
|
2 | 52 |
*/ |
53 |
protected Node offendingNode = null; |
|
54 |
||
55 |
/** |
|
35667 | 56 |
* Constructs an {@code IIOInvalidTreeException} with a |
57 |
* message string and a reference to the {@code Node} that |
|
2 | 58 |
* caused the parsing error. |
59 |
* |
|
35667 | 60 |
* @param message a {@code String} containing the reason for |
2 | 61 |
* the parsing failure. |
35667 | 62 |
* @param offendingNode the DOM {@code Node} that caused the |
63 |
* exception, or {@code null}. |
|
2 | 64 |
*/ |
65 |
public IIOInvalidTreeException(String message, Node offendingNode) { |
|
66 |
super(message); |
|
67 |
this.offendingNode = offendingNode; |
|
68 |
} |
|
69 |
||
70 |
/** |
|
35667 | 71 |
* Constructs an {@code IIOInvalidTreeException} with a |
2 | 72 |
* message string, a reference to an exception that caused this |
35667 | 73 |
* exception, and a reference to the {@code Node} that caused |
2 | 74 |
* the parsing error. |
75 |
* |
|
35667 | 76 |
* @param message a {@code String} containing the reason for |
2 | 77 |
* the parsing failure. |
35667 | 78 |
* @param cause the {@code Throwable} ({@code Error} or |
79 |
* {@code Exception}) that caused this exception to occur, |
|
80 |
* or {@code null}. |
|
81 |
* @param offendingNode the DOM {@code Node} that caused the |
|
82 |
* exception, or {@code null}. |
|
2 | 83 |
*/ |
84 |
public IIOInvalidTreeException(String message, Throwable cause, |
|
85 |
Node offendingNode) { |
|
86 |
super(message, cause); |
|
87 |
this.offendingNode = offendingNode; |
|
88 |
} |
|
89 |
||
90 |
/** |
|
35667 | 91 |
* Returns the {@code Node} that caused the error in parsing. |
2 | 92 |
* |
35667 | 93 |
* @return the offending {@code Node}. |
2 | 94 |
*/ |
95 |
public Node getOffendingNode() { |
|
96 |
return offendingNode; |
|
97 |
} |
|
98 |
} |