OSDN Git Service

Removed BeanException class: http://code.google.com/p/xerial/issues/detail?id=26
[xerial/xerial-core.git] / src / main / java / org / xerial / core / XerialErrorCode.java
1 /*--------------------------------------------------------------------------
2  *  Copyright 2008 Taro L. Saito
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 // XerialJ
18 //
19 // StandardErrorCode.java
20 // Since: Oct 27, 2008 1:02:08 PM
21 //
22 // $URL$
23 // $Author$
24 //--------------------------------------
25 package org.xerial.core;
26
27 /**
28  * Standard error codes
29  * 
30  * @author leo
31  * 
32  */
33 public enum XerialErrorCode implements ErrorCode {
34
35     // related to programming error
36     INVALID_STATE, SYNTAX_ERROR, NOT_INITIALIZED, UNSUPPORTED, INVALID_INPUT, INVALID_ARGUMENT, NOT_READY, INVALID_USAGE,
37     // collection
38     MISSING_ELEMENT,
39
40     // resources 
41     RESOURCE_NOT_FOUND,
42
43     // I/O
44     READ_ERROR, OUTPUT_ERROR, IO_EXCEPTION, INTERRUPTED,
45
46     // option parser error
47     DUPLICATE_OPTION, NO_OPTION, NO_USAGE_ANNOTATION, MISSING_ARGUMENT,
48
49     // type 
50     MISSING_TYPE_PARAMETER, NOT_A_COLLECTION, INACCESSIBLE_METHOD, WRONG_DATA_TYPE, DECODE_ERROR, ENCODE_ERROR,
51
52     // parse error
53     INVALID_TOKEN, PARSE_ERROR,
54
55     // general exception
56     INHERITED, HAS_AN_EXTENDED_ERROR_CODE,
57
58     
59     // Bean specific error codes
60     IOError,
61
62     NoMoreSubtree,
63
64     // XML
65     InvalidXMLData, ParserError, UnsupportedXMLDataType,
66
67     // JSON
68     InvalidJSONData, InvalidJSONArray,
69
70     UnsupportedDataType,
71
72     // Bean class
73     InvalidBeanClass, IllegalArgument, IllegalAccess, NoPublicConstructor, InstantiationFailure, InvalidNumberFormat, InvocationTargetException,
74
75     BeanObjectIsNull,
76
77     // binder
78     GetterCannotBeUsedToBindData, BindFailure, UnknownBeanUpdator, InvalidKeyAndValuePair, MapContainerIsNotFound, MapElementConstructionFailed, InvalidDateFormat, InvalidFormat, InvalidType;
79     ;
80
81     private final String description;
82
83     private XerialErrorCode() {
84         this.description = EMPTY_DESCRIPTION;
85     }
86
87     private XerialErrorCode(String description) {
88         this.description = description;
89     }
90
91     public String getCodeName() {
92         return name();
93     }
94
95     public String getDescription() {
96         return null;
97     }
98
99 }