Class ClassLoaderRepository

java.lang.Object
org.apache.bcel.util.ClassLoaderRepository
All Implemented Interfaces:
Repository

public class ClassLoaderRepository extends Object implements 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:
  • Field Details

  • Constructor Details

    • ClassLoaderRepository

      public ClassLoaderRepository(ClassLoader loader)
      Constructs a ClassLoaderRepository.
      Parameters:
      loader - The class loader.
  • Method Details

    • clear

      public void clear()
      Clear all entries from cache.
      Specified by:
      clear in interface Repository
    • findClass

      public JavaClass findClass(String className)
      Find an already defined JavaClass.
      Specified by:
      findClass in interface Repository
      Parameters:
      className - The class name.
      Returns:
      The JavaClass instance, or null.
    • getClassPath

      public ClassPath getClassPath()
      Description copied from interface: Repository
      Gets the ClassPath associated with this Repository.
      Specified by:
      getClassPath in interface Repository
      Returns:
      The ClassPath.
    • loadClass

      public JavaClass loadClass(Class<?> clazz) throws ClassNotFoundException
      Description copied from interface: Repository
      Finds the JavaClass instance for the given run-time class object.
      Specified by:
      loadClass in interface Repository
      Parameters:
      clazz - The class.
      Returns:
      The JavaClass instance.
      Throws:
      ClassNotFoundException - Thrown if the class can't be found.
    • loadClass

      public JavaClass loadClass(String className) throws ClassNotFoundException
      Lookup a JavaClass object from the Class Name provided.
      Specified by:
      loadClass in interface Repository
      Parameters:
      className - The class name.
      Returns:
      The JavaClass instance.
      Throws:
      ClassNotFoundException - Thrown if the class can't be found.
    • removeClass

      public void removeClass(JavaClass clazz)
      Remove class from repository
      Specified by:
      removeClass in interface Repository
      Parameters:
      clazz - The class to remove.
    • storeClass

      public void storeClass(JavaClass clazz)
      Store a new JavaClass into this Repository.
      Specified by:
      storeClass in interface Repository
      Parameters:
      clazz - The class to store.