View Javadoc
1   /*
2    * reserved comment block
3    * DO NOT REMOVE OR ALTER!
4    */
5   /*
6    * Copyright 2001, 2002,2004 The Apache Software Foundation.
7    *
8    * Licensed under the Apache License, Version 2.0 (the "License");
9    * you may not use this file except in compliance with the License.
10   * You may obtain a copy of the License at
11   *
12   *      http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS,
16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   * See the License for the specific language governing permissions and
18   * limitations under the License.
19   */
20  
21  package com.sun.org.apache.xerces.internal.xni.parser;
22  
23  import com.sun.org.apache.xerces.internal.util.Status;
24  import com.sun.org.apache.xerces.internal.xni.XNIException;
25  
26  /**
27   * An XNI parser configuration exception. This exception class extends
28   * <code>XNIException</code> in order to differentiate between general
29   * parsing errors and configuration errors.
30   *
31   * @author Andy Clark, IBM
32   *
33   * @version $Id: XMLConfigurationException.java,v 1.7 2010-11-01 04:40:22 joehw Exp $
34   */
35  public class XMLConfigurationException
36      extends XNIException {
37  
38      /** Serialization version. */
39      static final long serialVersionUID = -5437427404547669188L;
40  
41      //
42      // Data
43      //
44  
45      /** Exception type. */
46      protected Status fType;
47  
48      /** Identifier. */
49      protected String fIdentifier;
50  
51      //
52      // Constructors
53      //
54  
55      /**
56       * Constructs a configuration exception with the specified type
57       * and feature/property identifier.
58       *
59       * @param type       The type of the exception.
60       * @param identifier The feature or property identifier.
61       */
62      public XMLConfigurationException(Status type, String identifier) {
63          super(identifier);
64          fType = type;
65          fIdentifier = identifier;
66      } // <init>(short,String)
67  
68      /**
69       * Constructs a configuration exception with the specified type,
70       * feature/property identifier, and error message
71       *
72       * @param type       The type of the exception.
73       * @param identifier The feature or property identifier.
74       * @param message    The error message.
75       */
76      public XMLConfigurationException(Status type, String identifier,
77                                       String message) {
78          super(message);
79          fType = type;
80          fIdentifier = identifier;
81      } // <init>(short,String,String)
82  
83      //
84      // Public methods
85      //
86  
87      /**
88       * Returns the exception type.
89       */
90      public Status getType() {
91          return fType;
92      } // getType():short
93  
94      /** Returns the feature or property identifier. */
95      public String getIdentifier() {
96          return fIdentifier;
97      } // getIdentifier():String
98  
99  } // class XMLConfigurationException