/*
* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package javax.imageio.metadata;
import javax.imageio.IIOException;
import org.w3c.dom.Node;
/**
* An IIOInvalidTreeException
is thrown when an attempt
* by an IIOMetadata
object to parse a tree of
* IIOMetadataNode
s fails. The node that led to the
* parsing error may be stored. As with any parsing error, the actual
* error may occur at a different point that that where it is
* detected. The node returned by getOffendingNode
* should merely be considered as a clue to the actual nature of the
* problem.
*
* @see IIOMetadata#setFromTree
* @see IIOMetadata#mergeTree
* @see IIOMetadataNode
*
*/
public class IIOInvalidTreeException extends IIOException {
/**
* The Node
that led to the parsing error, or
* null
.
*/
protected Node offendingNode = null;
/**
* Constructs an IIOInvalidTreeException
with a
* message string and a reference to the Node
that
* caused the parsing error.
*
* @param message a String
containing the reason for
* the parsing failure.
* @param offendingNode the DOM Node
that caused the
* exception, or null
.
*/
public IIOInvalidTreeException(String message, Node offendingNode) {
super(message);
this.offendingNode = offendingNode;
}
/**
* Constructs an IIOInvalidTreeException
with a
* message string, a reference to an exception that caused this
* exception, and a reference to the Node
that caused
* the parsing error.
*
* @param message a String
containing the reason for
* the parsing failure.
* @param cause the Throwable
(Error
or
* Exception
) that caused this exception to occur,
* or null
.
* @param offendingNode the DOM Node
that caused the
* exception, or null
.
*/
public IIOInvalidTreeException(String message, Throwable cause,
Node offendingNode) {
super(message, cause);
this.offendingNode = offendingNode;
}
/**
* Returns the Node
that caused the error in parsing.
*
* @return the offending Node
.
*/
public Node getOffendingNode() {
return offendingNode;
}
}