public static Class < ? > getType ( String name , String library ) { try { // Load module if ( library != null && ! library . isEmpty ( ) ) { URL moduleUrl = new File ( library ) . toURI ( ) . toURL ( ) ; URLClassLoader child = new URLClassLoader ( new URL [ ] { moduleUrl } , ClassLoader . getSystemClassLoader ( ) ) ; return Class . forName ( name , true , child ) ; } else { return Class . forName ( name ) ; } } catch ( Exception ex ) { return null ; } }
Gets object type by its name and library where it is defined .