MCPcopy Create free account
hub / github.com/GateNLP/gate-core / getParameterClass

Method getParameterClass

src/main/java/gate/creole/Parameter.java:420–452  ·  view source on GitHub ↗

Find the class for this parameter type.

()

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 6

getCreoleRegisterMethod · 0.95
getClassLoaderMethod · 0.95
getResourceClassMethod · 0.95
getNlMethod · 0.95
loadClassMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected