|
|||||||||||||||||||
| This license of Clover is provided to support the development of JBind only. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover. | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| DomException.java | - | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
/* |
|
| 2 |
* JBind |
|
| 3 |
* |
|
| 4 |
* Copyright (c) by Stefan Wachter. All rights reserved. |
|
| 5 |
* |
|
| 6 |
* Usage, modification, and redistribution is subject to license terms that are |
|
| 7 |
* available at 'http://www.jbind.org'. The JBind license is like the |
|
| 8 |
* 'Apache Software License V 1.1'. |
|
| 9 |
*/ |
|
| 10 |
package org.jbind.xml.dom3.core; |
|
| 11 |
|
|
| 12 |
import org.w3c.dom.DOMException; |
|
| 13 |
|
|
| 14 |
public class DomException extends DOMException {
|
|
| 15 |
|
|
| 16 | 0 |
private static final String getMessage(short aCode) {
|
| 17 | 0 |
String res = null; |
| 18 | 0 |
switch (aCode) {
|
| 19 |
case INDEX_SIZE_ERR: |
|
| 20 | 0 |
res = "index size error"; |
| 21 | 0 |
break; |
| 22 |
case DOMSTRING_SIZE_ERR: |
|
| 23 | 0 |
res = "DomString size error"; |
| 24 | 0 |
break; |
| 25 |
case HIERARCHY_REQUEST_ERR: |
|
| 26 | 0 |
res = "hierarchy request error"; |
| 27 | 0 |
break; |
| 28 |
case WRONG_DOCUMENT_ERR: |
|
| 29 | 0 |
res = "wrong document error"; |
| 30 | 0 |
break; |
| 31 |
case INVALID_CHARACTER_ERR: |
|
| 32 | 0 |
res = "invalid character error"; |
| 33 | 0 |
break; |
| 34 |
case NO_DATA_ALLOWED_ERR: |
|
| 35 | 0 |
res = "no data allowed"; |
| 36 | 0 |
break; |
| 37 |
case NO_MODIFICATION_ALLOWED_ERR: |
|
| 38 | 0 |
res = "no modification allowed"; |
| 39 | 0 |
break; |
| 40 |
case NOT_FOUND_ERR: |
|
| 41 | 0 |
res = "not found"; |
| 42 | 0 |
break; |
| 43 |
case NOT_SUPPORTED_ERR: |
|
| 44 | 0 |
res = "not supported"; |
| 45 | 0 |
break; |
| 46 |
case INUSE_ATTRIBUTE_ERR: |
|
| 47 | 0 |
res = "attribute in use"; |
| 48 | 0 |
break; |
| 49 |
case INVALID_STATE_ERR: |
|
| 50 | 0 |
res = "invalid state"; |
| 51 | 0 |
break; |
| 52 |
case SYNTAX_ERR: |
|
| 53 | 0 |
res = "syntax error"; |
| 54 | 0 |
break; |
| 55 |
case INVALID_MODIFICATION_ERR: |
|
| 56 | 0 |
res = "invalid modification"; |
| 57 | 0 |
break; |
| 58 |
case NAMESPACE_ERR: |
|
| 59 | 0 |
res = "namespace"; |
| 60 | 0 |
break; |
| 61 |
case INVALID_ACCESS_ERR: |
|
| 62 | 0 |
res = "invalid access"; |
| 63 | 0 |
break; |
| 64 |
default: |
|
| 65 | 0 |
res = "unknown code (" + aCode + ")";
|
| 66 | 0 |
break; |
| 67 |
} |
|
| 68 | 0 |
return res; |
| 69 |
} |
|
| 70 |
|
|
| 71 | 0 |
public DomException(short aCode, String aMessage) {
|
| 72 | 0 |
super(aCode, getMessage(aCode) + ": " + aMessage); |
| 73 |
} |
|
| 74 |
|
|
| 75 | 0 |
public DomException(short aCode) {
|
| 76 | 0 |
super(aCode, getMessage(aCode)); |
| 77 |
} |
|
| 78 |
} |
|
| 79 |
|
|
||||||||||