public void blocker ( String blockerClass , String param , String value ) throws ClassNotFoundException , InstantiationException , IllegalAccessException , InvocationTargetException , NoSuchMethodException { Blocker blocker = ( Blocker ) Class . forName ( BLOCKER_PACKAGE + blockerClass ) . newInstance ( ) ; // upperCase the first letter of param param = param . substring ( 0 , 1 ) . toUpperCase ( ) + param . substring ( 1 , param . length ( ) ) ; Method m = blocker . getClass ( ) . getMethod ( "set" + param , new Class [ ] { Boolean . class } ) ; m . invoke ( blocker , new Object [ ] { Boolean . valueOf ( value ) } ) ; blockers . add ( blocker ) ; blockerNames . add ( blockerClass ) ; expt = null ; }
Load a blocker with optional boolean value