The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | * contributor license agreements. See the NOTICE file distributed with |
| 4 | * this work for additional information regarding copyright ownership. |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | * (the "License"); you may not use this file except in compliance with |
| 7 | * the License. You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | package javax.imageio.metadata; |
| 19 | |
| 20 | import org.w3c.dom.Node; |
| 21 | import javax.imageio.IIOException; |
| 22 | |
| 23 | /** |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 24 | * The IIOInvalidTreeException provides notification about fails of |
| 25 | * IIOMetadataNodes tree parsing by IIOMetadata object. |
| 26 | * |
| 27 | * @since Android 1.0 |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 28 | */ |
| 29 | public class IIOInvalidTreeException extends IIOException { |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * The offending node. |
| 33 | */ |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 34 | protected Node offendingNode = null; |
| 35 | |
| 36 | /** |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 37 | * Instantiates an IIOInvalidTreeException with the specified detailed |
| 38 | * message and specified offending Node. |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 39 | * |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 40 | * @param message |
| 41 | * the detailed message. |
| 42 | * @param offendingNode |
| 43 | * the offending node. |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 44 | */ |
| 45 | public IIOInvalidTreeException(String message, Node offendingNode) { |
| 46 | super(message); |
| 47 | this.offendingNode = offendingNode; |
| 48 | } |
| 49 | |
| 50 | /** |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 51 | * Instantiates a new IIOInvalidTreeException with the specified detailed |
| 52 | * message and specified offending Node. |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 53 | * |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 54 | * @param message |
| 55 | * the detailed message. |
| 56 | * @param cause |
| 57 | * the cause of this exception. |
| 58 | * @param offendingNode |
| 59 | * the offending node. |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 60 | */ |
| 61 | public IIOInvalidTreeException(String message, Throwable cause, Node offendingNode) { |
| 62 | super(message, cause); |
| 63 | this.offendingNode = offendingNode; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Gets the offending node. |
| 68 | * |
| 69 | * @return the offending node. |
| 70 | */ |
| 71 | public Node getOffendingNode() { |
| 72 | return offendingNode; |
| 73 | } |
| 74 | } |