KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > imageio > metadata > IIOInvalidTreeException


1 /*
2  * @(#)IIOInvalidTreeException.java 1.16 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.imageio.metadata;
9
10 import javax.imageio.IIOException JavaDoc;
11 import org.w3c.dom.Node JavaDoc;
12
13 /**
14  * An <code>IIOInvalidTreeException</code> is thrown when an attempt
15  * by an <code>IIOMetadata</code> object to parse a tree of
16  * <code>IIOMetadataNode</code>s fails. The node that led to the
17  * parsing error may be stored. As with any parsing error, the actual
18  * error may occur at a different point that that where it is
19  * detected. The node returned by <code>getOffendingNode</code>
20  * should merely be considered as a clue to the actual nature of the
21  * problem.
22  *
23  * @see IIOMetadata#setFromTree
24  * @see IIOMetadata#mergeTree
25  * @see IIOMetadataNode
26  *
27  * @version 0.5
28  */

29 public class IIOInvalidTreeException extends IIOException JavaDoc {
30     
31     /**
32      * The <code>Node</code> that led to the parsing error, or
33      * <code>null</code>.
34      */

35     protected Node JavaDoc offendingNode = null;
36
37     /**
38      * Constructs an <code>IIOInvalidTreeException</code> with a
39      * message string and a reference to the <code>Node</code> that
40      * caused the parsing error.
41      *
42      * @param message a <code>String</code> containing the reason for
43      * the parsing failure.
44      * @param offendingNode the DOM <code>Node</code> that caused the
45      * exception, or <code>null</code>.
46      */

47     public IIOInvalidTreeException(String JavaDoc message, Node JavaDoc offendingNode) {
48         super(message);
49         this.offendingNode = offendingNode;
50     }
51
52     /**
53      * Constructs an <code>IIOInvalidTreeException</code> with a
54      * message string, a reference to an exception that caused this
55      * exception, and a reference to the <code>Node</code> that caused
56      * the parsing error.
57      *
58      * @param message a <code>String</code> containing the reason for
59      * the parsing failure.
60      * @param cause the <code>Throwable</code> (<code>Error</code> or
61      * <code>Exception</code>) that caused this exception to occur,
62      * or <code>null</code>.
63      * @param offendingNode the DOM <code>Node</code> that caused the
64      * exception, or <code>null</code>.
65      */

66     public IIOInvalidTreeException(String JavaDoc message, Throwable JavaDoc cause,
67                                    Node JavaDoc offendingNode) {
68         super(message, cause);
69         this.offendingNode = offendingNode;
70     }
71
72     /**
73      * Returns the <code>Node</code> that caused the error in parsing.
74      *
75      * @return the offending <code>Node</code>.
76      */

77     public Node JavaDoc getOffendingNode() {
78         return offendingNode;
79     }
80 }
81
Popular Tags