1 12 package org.w3c.css.sac; 13 14 18 public class CSSException extends RuntimeException { 19 20 protected String s; 21 22 25 public static short SAC_UNSPECIFIED_ERR = 0; 26 27 30 public static short SAC_NOT_SUPPORTED_ERR = 1; 31 32 35 public static short SAC_SYNTAX_ERR = 2; 36 37 40 protected Exception e; 41 42 protected short code; 43 44 47 public CSSException() { 48 } 49 50 53 public CSSException(String s) { 54 this.code = SAC_UNSPECIFIED_ERR; 55 this.s = s; 56 } 57 58 62 public CSSException(Exception e) { 63 this.code = SAC_UNSPECIFIED_ERR; 64 this.e = e; 65 } 66 67 71 public CSSException(short code) { 72 this.code = code; 73 } 74 75 81 public CSSException(short code, String s, Exception e) { 82 this.code = code; 83 this.s = s; 84 this.e = e; 85 } 86 87 93 public String getMessage() { 94 if (s != null) { 95 return s; 96 } else if (e != null) { 97 return e.getMessage(); 98 } else { 99 return null; 100 } 101 } 102 103 106 public short getCode() { 107 return code; 108 } 109 110 113 public Exception getException() { 114 return e; 115 } 116 117 } 118 | Popular Tags |