Changeset 32318
- Timestamp:
- 2018-07-31T09:52:33+12:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/Dictionary.java
r30477 r32318 208 208 public String get(String key, String args[]) 209 209 { 210 // The following 'argsStr' doesn't appear to be used in rest of method, so211 // commenting out212 /*213 String argsStr = "";214 if (args != null)215 {216 for (String arg : args)217 {218 argsStr += arg + " ";219 }220 }221 */222 210 223 211 if (this.raw == null) … … 238 226 239 227 return processArgs(initial,args); 240 /* 241 // If the string contains arguments we have to insert them. 242 StringBuffer complete = new StringBuffer(); 243 // While we still have initial string left. 244 while (initial.length() > 0 && initial.indexOf('{') != -1 && initial.indexOf('}') != -1) 245 { 246 // Remove preamble 247 int opening = initial.indexOf('{'); 248 int closing = initial.indexOf('}'); 249 int comment_mark = initial.indexOf('-', opening); // May not exist 250 if (comment_mark > closing) 251 { // May also be detecting a later comment 252 comment_mark = -1; 253 } 254 complete.append(initial.substring(0, opening)); 255 256 // Parse arg_num 257 String arg_str = null; 258 if (comment_mark != -1) 259 { 260 arg_str = initial.substring(opening + 1, comment_mark); 261 } 262 else 263 { 264 arg_str = initial.substring(opening + 1, closing); 265 } 266 if (closing + 1 < initial.length()) 267 { 268 initial = initial.substring(closing + 1); 269 } 270 else 271 { 272 initial = ""; 273 } 274 int arg_num = Integer.parseInt(arg_str); 275 // Insert argument 276 if (args != null && 0 <= arg_num && arg_num < args.length) 277 { 278 complete.append(args[arg_num]); 279 } 280 } 281 complete.append(initial); 282 return complete.toString(); 283 */ 284 } 285 catch (Exception e) 286 { 287 //logger.debug("Dictionary Error: couldn't find string for key:" + key +" in resource "+this.resource); 228 } 229 catch (Exception e) 230 { 231 //logger.debug("Dictionary Error: couldn't find string for key:" + key +" in resource "+this.resource); 288 232 return null; 289 233 }
Note:
See TracChangeset
for help on using the changeset viewer.