01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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.xs;
19:
20: /**
21: * The XML Schema API operations only raise exceptions in "exceptional"
22: * circumstances, i.e., when an operation is impossible to perform (either
23: * for logical reasons, because data is lost, or because the implementation
24: * has become unstable).
25: * <p>Implementations should raise other exceptions under other circumstances.
26: * <p>Some languages and object systems do not support the concept of
27: * exceptions. For such systems, error conditions may be indicated using
28: * native error reporting mechanisms. For some bindings, for example,
29: * methods may return error codes similar to those listed in the
30: * corresponding method descriptions.
31: */
32: public class XSException extends RuntimeException {
33:
34: /** Serialization version. */
35: static final long serialVersionUID = 3111893084677917742L;
36:
37: public XSException(short code, String message) {
38: super (message);
39: this .code = code;
40: }
41:
42: public short code;
43: // ExceptionCode
44: /**
45: * If the implementation does not support the requested type of object or
46: * operation.
47: */
48: public static final short NOT_SUPPORTED_ERR = 1;
49: /**
50: * If index or size is negative, or greater than the allowed value
51: */
52: public static final short INDEX_SIZE_ERR = 2;
53:
54: }
|