Class ClassLoaderRepository
java.lang.Object
org.apache.bcel.util.ClassLoaderRepository
- All Implemented Interfaces:
Repository
The repository maintains information about which classes have been loaded.
It loads its data from the ClassLoader implementation passed into its constructor.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionClassLoaderRepository(ClassLoader loader) Constructs a ClassLoaderRepository. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all entries from cache.Find an already defined JavaClass.Gets the ClassPath associated with this Repository.Finds the JavaClass instance for the given run-time class object.Lookup a JavaClass object from the Class Name provided.voidremoveClass(JavaClass clazz) Remove class from repositoryvoidstoreClass(JavaClass clazz) Store a new JavaClass into this Repository.
-
Constructor Details
-
ClassLoaderRepository
Constructs a ClassLoaderRepository.- Parameters:
loader- the class loader.
-
-
Method Details
-
clear
-
findClass
Find an already defined JavaClass.- Specified by:
findClassin interfaceRepository- Parameters:
className- the class name.- Returns:
- the JavaClass instance, or null.
-
getClassPath
Description copied from interface:RepositoryGets the ClassPath associated with this Repository.- Specified by:
getClassPathin interfaceRepository- Returns:
- the ClassPath.
-
loadClass
Description copied from interface:RepositoryFinds the JavaClass instance for the given run-time class object.- Specified by:
loadClassin interfaceRepository- Parameters:
clazz- the class.- Returns:
- the JavaClass instance.
- Throws:
ClassNotFoundException- if the class can't be found.
-
loadClass
Lookup a JavaClass object from the Class Name provided.- Specified by:
loadClassin interfaceRepository- Parameters:
className- the class name.- Returns:
- the JavaClass instance.
- Throws:
ClassNotFoundException- if the class can't be found.
-
removeClass
Remove class from repository- Specified by:
removeClassin interfaceRepository- Parameters:
clazz- the class to remove.
-
storeClass
Store a new JavaClass into this Repository.- Specified by:
storeClassin interfaceRepository- Parameters:
clazz- the class to store.
-