Class GeneratedClassLoader

java.lang.Object
java.lang.ClassLoader
org.biojava.utils.bytecode.GeneratedClassLoader

public class GeneratedClassLoader extends ClassLoader
A class loader that actually produces real Java classes from GeneratedCodeClass instances.
Author:
Thomas Down, Matthew Pocock
  • Constructor Details

    • GeneratedClassLoader

      public GeneratedClassLoader()
      Create a new loader with the default parent.
    • GeneratedClassLoader

      public GeneratedClassLoader(ClassLoader parent)
      Create a new loader with an explicitly set parent class loader.
      Parameters:
      parent - the parent ClassLoader
  • Method Details

    • defineClass

      public Class defineClass(GeneratedCodeClass cc) throws CodeException
      Define a class based upon a GeneratedCodeClass.
      Parameters:
      cc - the GeneratedCodeClass to define
      Returns:
      the newly defined class
      Throws:
      CodeException - if there was a failure defining the class
    • hasGeneratedClass

      public boolean hasGeneratedClass(String name)
      Discover if a class for this name has already been defined by this class loader.
      Parameters:
      name - the name of the class
      Returns:
      true if the class has already been defined by this loader