public static Class < ? > [ ] toParamClasses ( String methodDescriptor , ClassLoader classLoader ) throws ClassNotFoundException { Type [ ] paramTypes = Type . getArgumentTypes ( methodDescriptor ) ; Class < ? > [ ] paramClasses = new Class < ? > [ paramTypes . length ] ; for ( int i = 0 ; i < paramClasses . length ; i ++ ) { paramClasses [ i ] = toClass ( paramTypes [ i ] , classLoader ) ; } return paramClasses ; }
Given a method descriptor extract the parameter descriptor and convert into corresponding Class objects . This requires a reference to a class loader to convert type names into Class objects .