1 30 31 package com.steadystate.css.dom; 32 33 import java.util.*; 34 import org.w3c.dom.*; 35 36 41 public class DOMExceptionImpl extends DOMException { 42 43 public static final int SYNTAX_ERROR = 0; 44 public static final int ARRAY_OUT_OF_BOUNDS = 1; 45 public static final int READ_ONLY_STYLE_SHEET = 2; 46 public static final int EXPECTING_UNKNOWN_RULE = 3; 47 public static final int EXPECTING_STYLE_RULE = 4; 48 public static final int EXPECTING_CHARSET_RULE = 5; 49 public static final int EXPECTING_IMPORT_RULE = 6; 50 public static final int EXPECTING_MEDIA_RULE = 7; 51 public static final int EXPECTING_FONT_FACE_RULE = 8; 52 public static final int EXPECTING_PAGE_RULE = 9; 53 public static final int FLOAT_ERROR = 10; 54 public static final int STRING_ERROR = 11; 55 public static final int COUNTER_ERROR = 12; 56 public static final int RECT_ERROR = 13; 57 public static final int RGBCOLOR_ERROR = 14; 58 public static final int CHARSET_NOT_FIRST = 15; 59 public static final int CHARSET_NOT_UNIQUE = 16; 60 public static final int IMPORT_NOT_FIRST = 17; 61 public static final int NOT_FOUND = 18; 62 public static final int NOT_IMPLEMENTED = 19; 63 64 private static ResourceBundle _exceptionResource = 65 ResourceBundle.getBundle( 66 "com.steadystate.css.parser.ExceptionResource", 67 Locale.getDefault()); 68 69 public DOMExceptionImpl(short code, int messageKey) { 70 super(code, _exceptionResource.getString(keyString(messageKey))); 71 } 72 73 public DOMExceptionImpl(int code, int messageKey) { 74 super((short) code, _exceptionResource.getString(keyString(messageKey))); 75 } 76 77 public DOMExceptionImpl(short code, int messageKey, String info) { 78 super(code, _exceptionResource.getString(keyString(messageKey))); 79 } 80 81 private static String keyString(int key) { 82 return "s" + String.valueOf(key); 83 } 84 } 85 | Popular Tags |