private void addClasses ( XMLStreamWriter writer , File jarFile , boolean mapClassMethods ) throws IOException , ClassNotFoundException , XMLStreamException , IntrospectionException { ClassLoader currentThreadClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; URLClassLoader loader = new URLClassLoader ( new URL [ ] { jarFile . toURI ( ) . toURL ( ) } , currentThreadClassLoader ) ; JarFile jar = new JarFile ( jarFile ) ; Enumeration < JarEntry > enumeration = jar . entries ( ) ; while ( enumeration . hasMoreElements ( ) ) { JarEntry jarEntry = enumeration . nextElement ( ) ; if ( ! jarEntry . isDirectory ( ) && jarEntry . getName ( ) . endsWith ( ".class" ) ) { addClass ( loader , jarEntry , writer , mapClassMethods ) ; } } jar . close ( ) ; }
Add classes to the map file .