private static Class<?> classForParam(String param){
  Class<?> r;
  if (param.equals("int")) {
    r=int.class;
  }
 else   if (param.equals("long")) {
    r=long.class;
  }
 else   if (param.equals("byte")) {
    r=byte.class;
  }
 else   if (param.equals("short")) {
    r=short.class;
  }
 else   if (param.equals("char")) {
    r=char.class;
  }
 else   if (param.equals("boolean")) {
    r=boolean.class;
  }
 else   try {
    r=Class.forName(param);
  }
 catch (  ClassNotFoundException e) {
    try {
      r=Class.forName("java.lang." + param);
    }
 catch (    ClassNotFoundException f) {
      throw new RuntimeException(e);
    }
  }
  return r;
}

private static Class < ? > classForParam ( String param ) { Class < ? > r ; if ( param . equals ( "int" ) ) { r = int . class ; } else if ( param . equals ( "long" ) ) { r = long . class ; } else if ( param . equals ( "byte" ) ) { r = byte . class ; } else if ( param . equals ( "short" ) ) { r = short . class ; } else if ( param . equals ( "char" ) ) { r = char . class ; } else if ( param . equals ( "boolean" ) ) { r = boolean . class ; } else try { r = Class . forName ( param ) ; } catch ( ClassNotFoundException e ) { try { r = Class . forName ( "java.lang." + param ) ; } catch ( ClassNotFoundException f ) { throw new RuntimeException ( e ) ; } } return r ; }
turn a string into a class object , applying some simple mappings for primitives etc .
