public JavaCompiler createCompiler ( final String pHint ) { final String className ; if ( pHint . indexOf ( ' ' ) < 0 ) { className = "org.drools.compiler.commons.jci.compilers." + ClassUtils . toJavaCasing ( pHint ) + "JavaCompiler" ; } else { className = pHint ; } Class clazz = ( Class ) classCache . get ( className ) ; if ( clazz == null ) { try { clazz = Class . forName ( className ) ; classCache . put ( className , clazz ) ; } catch ( ClassNotFoundException e ) { clazz = null ; } } if ( clazz == null ) { return null ; } try { return ( JavaCompiler ) clazz . newInstance ( ) ; } catch ( Throwable t ) { return null ; } }
Tries to guess the class name by convention . So for compilers following the naming convention