Find the class for this parameter type.
()
| 418 | |
| 419 | /** Find the class for this parameter type. */ |
| 420 | protected Class<?> getParameterClass() throws ParameterException |
| 421 | { |
| 422 | // get java builtin classes via class; else look in the register |
| 423 | try { |
| 424 | ResourceData resData = Gate.getCreoleRegister().get(typeName); |
| 425 | if(resData == null){ |
| 426 | paramClass = Gate.getClassLoader().loadClass(typeName); |
| 427 | }else{ |
| 428 | paramClass = resData.getResourceClass(); |
| 429 | } |
| 430 | |
| 431 | // if(typeName.startsWith("java.")) |
| 432 | // paramClass = Class.forName(typeName); |
| 433 | // else { |
| 434 | // ResourceData resData = |
| 435 | // (ResourceData) Gate.getCreoleRegister().get(typeName); |
| 436 | // if(resData == null) |
| 437 | // throw new ParameterException( |
| 438 | // "No resource data for " + typeName + " in Parameter/getParamClz" |
| 439 | // ); |
| 440 | // paramClass = resData.getResourceClass(); |
| 441 | // } |
| 442 | } catch(ClassNotFoundException e) { |
| 443 | throw new ParameterException( |
| 444 | "Couldn't find class " + typeName + ": " + Strings.getNl() + e |
| 445 | ); |
| 446 | } |
| 447 | |
| 448 | if(paramClass == null) |
| 449 | throw new ParameterException("Couldn't find class " + typeName); |
| 450 | |
| 451 | return paramClass; |
| 452 | } // getParameterClass |
| 453 | |
| 454 | /** String representation */ |
| 455 | @Override |
no test coverage detected