public static Class < ? > loadClass ( String classname , DataFormat < ? > dataFormat ) { // first try context classoader ClassLoader cl = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( cl != null ) { LOG . tryLoadingClass ( classname , cl ) ; try { return cl . loadClass ( classname ) ; } catch ( Exception e ) { // ignore } } // else try the classloader which loaded the dataformat cl = dataFormat . getClass ( ) . getClassLoader ( ) ; try { LOG . tryLoadingClass ( classname , cl ) ; return cl . loadClass ( classname ) ; } catch ( ClassNotFoundException e ) { throw LOG . classNotFound ( classname , e ) ; } }
Used by dataformats if they need to load a class