1 55 56 package org.apache.commons.el; 57 58 import java.util.ResourceBundle ; 59 import java.util.MissingResourceException ; 60 61 71 72 public class Constants 73 { 74 77 static ResourceBundle sResources = 78 ResourceBundle.getBundle ("org.apache.commons.el.Resources"); 79 80 84 public static final String EXCEPTION_GETTING_BEANINFO = 85 getStringResource ("EXCEPTION_GETTING_BEANINFO"); 86 87 public static final String NULL_EXPRESSION_STRING = 88 getStringResource ("NULL_EXPRESSION_STRING"); 89 90 public static final String PARSE_EXCEPTION = 91 getStringResource ("PARSE_EXCEPTION"); 92 93 public static final String CANT_GET_PROPERTY_OF_NULL = 94 getStringResource ("CANT_GET_PROPERTY_OF_NULL"); 95 96 public static final String NO_SUCH_PROPERTY = 97 getStringResource ("NO_SUCH_PROPERTY"); 98 99 public static final String NO_GETTER_METHOD = 100 getStringResource ("NO_GETTER_METHOD"); 101 102 public static final String ERROR_GETTING_PROPERTY = 103 getStringResource ("ERROR_GETTING_PROPERTY"); 104 105 public static final String CANT_GET_INDEXED_VALUE_OF_NULL = 106 getStringResource ("CANT_GET_INDEXED_VALUE_OF_NULL"); 107 108 public static final String CANT_GET_NULL_INDEX = 109 getStringResource ("CANT_GET_NULL_INDEX"); 110 111 public static final String NULL_INDEX = 112 getStringResource ("NULL_INDEX"); 113 114 public static final String BAD_INDEX_VALUE = 115 getStringResource ("BAD_INDEX_VALUE"); 116 117 public static final String EXCEPTION_ACCESSING_LIST = 118 getStringResource ("EXCEPTION_ACCESSING_LIST"); 119 120 public static final String EXCEPTION_ACCESSING_ARRAY = 121 getStringResource ("EXCEPTION_ACCESSING_ARRAY"); 122 123 public static final String CANT_FIND_INDEX = 124 getStringResource ("CANT_FIND_INDEX"); 125 126 public static final String TOSTRING_EXCEPTION = 127 getStringResource ("TOSTRING_EXCEPTION"); 128 129 public static final String BOOLEAN_TO_NUMBER = 130 getStringResource ("BOOLEAN_TO_NUMBER"); 131 132 public static final String STRING_TO_NUMBER_EXCEPTION = 133 getStringResource ("STRING_TO_NUMBER_EXCEPTION"); 134 135 public static final String COERCE_TO_NUMBER = 136 getStringResource ("COERCE_TO_NUMBER"); 137 138 public static final String BOOLEAN_TO_CHARACTER = 139 getStringResource ("BOOLEAN_TO_CHARACTER"); 140 141 public static final String EMPTY_STRING_TO_CHARACTER = 142 getStringResource ("EMPTY_STRING_TO_CHARACTER"); 143 144 public static final String COERCE_TO_CHARACTER = 145 getStringResource ("COERCE_TO_CHARACTER"); 146 147 public static final String NULL_TO_BOOLEAN = 148 getStringResource ("NULL_TO_BOOLEAN"); 149 150 public static final String STRING_TO_BOOLEAN = 151 getStringResource ("STRING_TO_BOOLEAN"); 152 153 public static final String COERCE_TO_BOOLEAN = 154 getStringResource ("COERCE_TO_BOOLEAN"); 155 156 public static final String COERCE_TO_OBJECT = 157 getStringResource ("COERCE_TO_OBJECT"); 158 159 public static final String NO_PROPERTY_EDITOR = 160 getStringResource ("NO_PROPERTY_EDITOR"); 161 162 public static final String PROPERTY_EDITOR_ERROR = 163 getStringResource ("PROPERTY_EDITOR_ERROR"); 164 165 public static final String ARITH_OP_NULL = 166 getStringResource ("ARITH_OP_NULL"); 167 168 public static final String ARITH_OP_BAD_TYPE = 169 getStringResource ("ARITH_OP_BAD_TYPE"); 170 171 public static final String ARITH_ERROR = 172 getStringResource ("ARITH_ERROR"); 173 174 public static final String ERROR_IN_EQUALS = 175 getStringResource ("ERROR_IN_EQUALS"); 176 177 public static final String UNARY_OP_BAD_TYPE = 178 getStringResource ("UNARY_OP_BAD_TYPE"); 179 180 public static final String NAMED_VALUE_NOT_FOUND = 181 getStringResource ("NAMED_VALUE_NOT_FOUND"); 182 183 public static final String CANT_GET_INDEXED_PROPERTY = 184 getStringResource ("CANT_GET_INDEXED_PROPERTY"); 185 186 public static final String COMPARABLE_ERROR = 187 getStringResource ("COMPARABLE_ERROR"); 188 189 public static final String BAD_IMPLICIT_OBJECT = 190 getStringResource ("BAD_IMPLICIT_OBJECT"); 191 192 public static final String ATTRIBUTE_EVALUATION_EXCEPTION = 193 getStringResource ("ATTRIBUTE_EVALUATION_EXCEPTION"); 194 195 public static final String ATTRIBUTE_PARSE_EXCEPTION = 196 getStringResource ("ATTRIBUTE_PARSE_EXCEPTION"); 197 198 public static final String UNKNOWN_FUNCTION = 199 getStringResource ("UNKNOWN_FUNCTION"); 200 201 public static final String INAPPROPRIATE_FUNCTION_ARG_COUNT = 202 getStringResource ("INAPPROPRIATE_FUNCTION_ARG_COUNT"); 203 204 public static final String FUNCTION_INVOCATION_ERROR = 205 getStringResource ("FUNCTION_INVOCATION_ERROR"); 206 207 208 215 public static String getStringResource (String pResourceName) 216 throws MissingResourceException 217 { 218 try { 219 String ret = sResources.getString (pResourceName); 220 if (ret == null) { 221 String str = "ERROR: Unable to load resource " + pResourceName; 222 System.err.println (str); 223 throw new MissingResourceException 224 (str, 225 "org.apache.commons.el.Constants", 226 pResourceName); 227 } 228 else { 229 return ret; 230 } 231 } 232 catch (MissingResourceException exc) { 233 System.err.println ("ERROR: Unable to load resource " + 234 pResourceName + 235 ": " + 236 exc); 237 throw exc; 238 } 239 } 240 241 } 243 | Popular Tags |