Package org.apache.bcel.util
Interface Repository
-
- All Known Implementing Classes:
AbstractClassPathRepository,ClassLoaderRepository,ClassPathRepository,LruCacheClassPathRepository,MemorySensitiveClassPathRepository,SyntheticRepository
public interface RepositoryAbstract definition of a class repository. Instances may be used to load classes from different sources and may be used in the Repository.setRepository method.- See Also:
Repository
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Clears all entries from cache.JavaClassfindClass(java.lang.String className)Finds the class with the name provided, if the class isn't there, return NULL.ClassPathgetClassPath()Gets the ClassPath associated with this Repository.JavaClassloadClass(java.lang.Class<?> clazz)Finds the JavaClass instance for the given run-time class object.JavaClassloadClass(java.lang.String className)Finds the class with the name provided, if the class isn't there, make an attempt to load it.voidremoveClass(JavaClass clazz)Removes class from repository.voidstoreClass(JavaClass clazz)Stores the provided class under "clazz.getClassName()".
-
-
-
Method Detail
-
clear
void clear()
Clears all entries from cache.
-
findClass
JavaClass findClass(java.lang.String className)
Finds the class with the name provided, if the class isn't there, return NULL.- Parameters:
className- the class name.- Returns:
- the JavaClass instance, or null.
-
getClassPath
ClassPath getClassPath()
Gets the ClassPath associated with this Repository.- Returns:
- the ClassPath.
-
loadClass
JavaClass loadClass(java.lang.Class<?> clazz) throws java.lang.ClassNotFoundException
Finds the JavaClass instance for the given run-time class object.- Parameters:
clazz- the class.- Returns:
- the JavaClass instance.
- Throws:
java.lang.ClassNotFoundException- if the class can't be found.
-
loadClass
JavaClass loadClass(java.lang.String className) throws java.lang.ClassNotFoundException
Finds the class with the name provided, if the class isn't there, make an attempt to load it.- Parameters:
className- the class name.- Returns:
- the JavaClass instance.
- Throws:
java.lang.ClassNotFoundException- if the class can't be found.
-
removeClass
void removeClass(JavaClass clazz)
Removes class from repository.- Parameters:
clazz- the class to remove.
-
storeClass
void storeClass(JavaClass clazz)
Stores the provided class under "clazz.getClassName()".- Parameters:
clazz- the class to store.
-
-