// CLASSNAME X JAVACLASS this.loader = loader;
Clear all entries from cache. loadedClasses.clear();
loadedClasses.clear();
Find an already defined JavaClass. if ( loadedClasses.containsKey( className )) { return (JavaClass) loadedClasses.get( className ); } else { return null; }
if ( loadedClasses.containsKey( className )) { return (JavaClass) loadedClasses.get( className ); } else { return null; }
Lookup a JavaClass object from the Class Name provided. String classFile = className.replace('.", '/"); JavaClass RC = findClass( className ); if (RC != null) { return RC; } try { InputStream is = loader.getResourceAsStream( classFile + ".class" ); if(is == null) { throw new ClassNotFoundException(className + " not found."); } ClassParser parser = new ClassParser( is, className ); RC = parser.parse(); storeClass( RC ); return RC; } catch (IOException e) { throw new ClassNotFoundException( e.toString() ); }
String classFile = className.replace('.", '/"); JavaClass RC = findClass( className ); if (RC != null) { return RC; } try { InputStream is = loader.getResourceAsStream( classFile + ".class" ); if(is == null) { throw new ClassNotFoundException(className + " not found."); } ClassParser parser = new ClassParser( is, className ); RC = parser.parse(); storeClass( RC ); return RC; } catch (IOException e) { throw new ClassNotFoundException( e.toString() ); }
return loadClass(clazz.getName());
Remove class from repository loadedClasses.remove(clazz.getClassName());
loadedClasses.remove(clazz.getClassName());
Store a new JavaClass into this Repository. loadedClasses.put( clazz.getClassName(), clazz ); clazz.setRepository( this );
loadedClasses.put( clazz.getClassName(), clazz ); clazz.setRepository( this );