KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > xni > parser > XMLConfigurationException


1 /*
2  * Copyright 2001, 2002,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.xerces.xni.parser;
18
19 import org.apache.xerces.xni.XNIException;
20
21 /**
22  * An XNI parser configuration exception. This exception class extends
23  * <code>XNIException</code> in order to differentiate between general
24  * parsing errors and configuration errors.
25  *
26  * @author Andy Clark, IBM
27  *
28  * @version $Id: XMLConfigurationException.java,v 1.6 2004/08/15 21:22:15 mrglavas Exp $
29  */

30 public class XMLConfigurationException
31     extends XNIException {
32
33     /** Serialization version. */
34     static final long serialVersionUID = -5437427404547669188L;
35     
36     //
37
// Constants
38
//
39

40     /** Exception type: identifier not recognized. */
41     public static final short NOT_RECOGNIZED = 0;
42
43     /** Exception type: identifier not supported. */
44     public static final short NOT_SUPPORTED = 1;
45
46     //
47
// Data
48
//
49

50     /** Exception type. */
51     protected short fType;
52
53     /** Identifier. */
54     protected String JavaDoc fIdentifier;
55
56     //
57
// Constructors
58
//
59

60     /**
61      * Constructs a configuration exception with the specified type
62      * and feature/property identifier.
63      *
64      * @param type The type of the exception.
65      * @param identifier The feature or property identifier.
66      *
67      * @see #NOT_RECOGNIZED
68      * @see #NOT_SUPPORTED
69      */

70     public XMLConfigurationException(short type, String JavaDoc identifier) {
71         super(identifier);
72         fType = type;
73         fIdentifier = identifier;
74     } // <init>(short,String)
75

76     /**
77      * Constructs a configuration exception with the specified type,
78      * feature/property identifier, and error message
79      *
80      * @param type The type of the exception.
81      * @param identifier The feature or property identifier.
82      * @param message The error message.
83      *
84      * @see #NOT_RECOGNIZED
85      * @see #NOT_SUPPORTED
86      */

87     public XMLConfigurationException(short type, String JavaDoc identifier,
88                                      String JavaDoc message) {
89         super(message);
90         fType = type;
91         fIdentifier = identifier;
92     } // <init>(short,String,String)
93

94     //
95
// Public methods
96
//
97

98     /**
99      * Returns the exception type.
100      *
101      * @see #NOT_RECOGNIZED
102      * @see #NOT_SUPPORTED
103      */

104     public short getType() {
105         return fType;
106     } // getType():short
107

108     /** Returns the feature or property identifier. */
109     public String JavaDoc getIdentifier() {
110         return fIdentifier;
111     } // getIdentifier():String
112

113 } // class XMLConfigurationException
114
Popular Tags