Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/imageio/metadata/IIOInvalidTreeException.java
38918 views
/*1* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.imageio.metadata;2627import javax.imageio.IIOException;28import org.w3c.dom.Node;2930/**31* An <code>IIOInvalidTreeException</code> is thrown when an attempt32* by an <code>IIOMetadata</code> object to parse a tree of33* <code>IIOMetadataNode</code>s fails. The node that led to the34* parsing error may be stored. As with any parsing error, the actual35* error may occur at a different point that that where it is36* detected. The node returned by <code>getOffendingNode</code>37* should merely be considered as a clue to the actual nature of the38* problem.39*40* @see IIOMetadata#setFromTree41* @see IIOMetadata#mergeTree42* @see IIOMetadataNode43*44*/45public class IIOInvalidTreeException extends IIOException {4647/**48* The <code>Node</code> that led to the parsing error, or49* <code>null</code>.50*/51protected Node offendingNode = null;5253/**54* Constructs an <code>IIOInvalidTreeException</code> with a55* message string and a reference to the <code>Node</code> that56* caused the parsing error.57*58* @param message a <code>String</code> containing the reason for59* the parsing failure.60* @param offendingNode the DOM <code>Node</code> that caused the61* exception, or <code>null</code>.62*/63public IIOInvalidTreeException(String message, Node offendingNode) {64super(message);65this.offendingNode = offendingNode;66}6768/**69* Constructs an <code>IIOInvalidTreeException</code> with a70* message string, a reference to an exception that caused this71* exception, and a reference to the <code>Node</code> that caused72* the parsing error.73*74* @param message a <code>String</code> containing the reason for75* the parsing failure.76* @param cause the <code>Throwable</code> (<code>Error</code> or77* <code>Exception</code>) that caused this exception to occur,78* or <code>null</code>.79* @param offendingNode the DOM <code>Node</code> that caused the80* exception, or <code>null</code>.81*/82public IIOInvalidTreeException(String message, Throwable cause,83Node offendingNode) {84super(message, cause);85this.offendingNode = offendingNode;86}8788/**89* Returns the <code>Node</code> that caused the error in parsing.90*91* @return the offending <code>Node</code>.92*/93public Node getOffendingNode() {94return offendingNode;95}96}979899