/** {@inheritDoc} */ public ReferableSourceFile loadSource(ClassName className) { // TODO: Access restrictions for source files!! // if the package name is not in the map of all packages, return immediately List<ClassFileLoader> classFileLoaderList = this._allPackages.get(className.getPackageName()); if (classFileLoaderList == null) { return null; } // search for the source file for (ClassFileLoader classFileLoader : classFileLoaderList) { ReferableSourceFile sourceFile = classFileLoader.loadSource(className); if (sourceFile != null) { return sourceFile; } } // last resort: return null return null; }
/** {@inheritDoc} */ public ClassFile loadClass(ClassName className) { // get the class file loader list List<ClassFileLoader> classFileLoaderList = this._allPackages.get(className.getPackageName()); // return if class file loader list is null if (classFileLoaderList == null) { return null; } // declare the result ClassFile result = null; // try to find the class file... for (ClassFileLoader classFileLoader : classFileLoaderList) { // try to load class file... ClassFile classFile = classFileLoader.loadClass(className); // class file was found... if (classFile != null) { // if the class file has no access restrictions, return the class file... if (!classFile.hasAccessRestriction()) { return classFile; } // else set the class file a result, if result is null else if (result == null) { result = classFile; } } } // return the result return result; }