~vcs-imports/xena/trunk

« back to all changes in this revision

Viewing changes to ext/src/xerces-2_9_1/src/org/apache/xerces/xni/parser/XMLConfigurationException.java

  • Committer: matthewoliver
  • Date: 2009-12-10 03:18:07 UTC
  • Revision ID: vcs-imports@canonical.com-20091210031807-l086qguzdlljtkl9
Merged Xena Testing into Xena Stable for the Xena 5 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 org.apache.xerces.xni.parser;
 
19
 
 
20
import org.apache.xerces.xni.XNIException;
 
21
 
 
22
/**
 
23
 * An XNI parser configuration exception. This exception class extends
 
24
 * <code>XNIException</code> in order to differentiate between general
 
25
 * parsing errors and configuration errors.
 
26
 *
 
27
 * @author Andy Clark, IBM
 
28
 *
 
29
 * @version $Id: XMLConfigurationException.java,v 1.2 2009/12/10 03:18:08 matthewoliver Exp $
 
30
 */
 
31
public class XMLConfigurationException
 
32
    extends XNIException {
 
33
 
 
34
    /** Serialization version. */
 
35
    static final long serialVersionUID = -5437427404547669188L;
 
36
    
 
37
    //
 
38
    // Constants
 
39
    //
 
40
 
 
41
    /** Exception type: identifier not recognized. */
 
42
    public static final short NOT_RECOGNIZED = 0;
 
43
 
 
44
    /** Exception type: identifier not supported. */
 
45
    public static final short NOT_SUPPORTED = 1;
 
46
 
 
47
    //
 
48
    // Data
 
49
    //
 
50
 
 
51
    /** Exception type. */
 
52
    protected short fType;
 
53
 
 
54
    /** Identifier. */
 
55
    protected String fIdentifier;
 
56
 
 
57
    //
 
58
    // Constructors
 
59
    //
 
60
 
 
61
    /** 
 
62
     * Constructs a configuration exception with the specified type
 
63
     * and feature/property identifier.
 
64
     *
 
65
     * @param type       The type of the exception.
 
66
     * @param identifier The feature or property identifier.
 
67
     *
 
68
     * @see #NOT_RECOGNIZED
 
69
     * @see #NOT_SUPPORTED
 
70
     */
 
71
    public XMLConfigurationException(short type, String identifier) {
 
72
        super(identifier);
 
73
        fType = type;
 
74
        fIdentifier = identifier;
 
75
    } // <init>(short,String)
 
76
 
 
77
    /** 
 
78
     * Constructs a configuration exception with the specified type,
 
79
     * feature/property identifier, and error message
 
80
     *
 
81
     * @param type       The type of the exception.
 
82
     * @param identifier The feature or property identifier.
 
83
     * @param message    The error message.
 
84
     *
 
85
     * @see #NOT_RECOGNIZED
 
86
     * @see #NOT_SUPPORTED
 
87
     */
 
88
    public XMLConfigurationException(short type, String identifier,
 
89
                                     String message) {
 
90
        super(message);
 
91
        fType = type;
 
92
        fIdentifier = identifier;
 
93
    } // <init>(short,String,String)
 
94
 
 
95
    //
 
96
    // Public methods
 
97
    //
 
98
 
 
99
    /** 
 
100
     * Returns the exception type. 
 
101
     *
 
102
     * @see #NOT_RECOGNIZED
 
103
     * @see #NOT_SUPPORTED
 
104
     */
 
105
    public short getType() {
 
106
        return fType;
 
107
    } // getType():short
 
108
 
 
109
    /** Returns the feature or property identifier. */
 
110
    public String getIdentifier() {
 
111
        return fIdentifier;
 
112
    } // getIdentifier():String
 
113
 
 
114
} // class XMLConfigurationException