01: /*
02: * Copyright 2006 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.xml.client;
17:
18: /**
19: * Thrown when DOM exceptions occur. Two subclasses exist:
20: * <code>DOMNodeException</code> and <code>DOMParseException</code> which
21: * give more detailed information for DOM manipulation errors and parse errors,
22: * respectively. All <code>DOMExceptions</code> thrown in this package will be
23: * instances of one of those two classes.
24: */
25: public class DOMException extends RuntimeException {
26:
27: public static final short INVALID_ACCESS_ERR = 15;
28: public static final short INVALID_CHARACTER_ERR = 5;
29: public static final short INVALID_MODIFICATION_ERR = 13;
30: public static final short INVALID_STATE_ERR = 11;
31: public static final short SYNTAX_ERR = 12;
32:
33: protected short code;
34:
35: public DOMException(short code, String message) {
36: super (message);
37: this .code = code;
38: }
39:
40: /**
41: * This method gets the code of this <code>DOMException</code>.
42: *
43: * @return the code of this <code>DOMException</code>
44: */
45: public short getCode() {
46: return code;
47: }
48:
49: }
|