private ClassSignature loadClassFromJigsaw ( String classname ) throws IOException { if ( method_Class_getModule == null || method_Module_getName == null ) { return null ; // not Jigsaw Module System } final Class < ? > clazz ; final String moduleName ; try { clazz = Class . forName ( classname , false , loader ) ; final Object module = method_Class_getModule . invoke ( clazz ) ; moduleName = ( String ) method_Module_getName . invoke ( module ) ; } catch ( Exception e ) { return null ; // not found } return new ClassSignature ( clazz , AsmUtils . isRuntimeModule ( moduleName ) ) ; }
Loads the class from Java9 s module system and uses reflection to get methods and fields .