Package org.biojava.utils.bytecode

# 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 Summary

Constructors
Constructor
Description
`GeneratedClassLoader()`
Create a new loader with the default parent.
`GeneratedClassLoader(ClassLoader parent)`
Create a new loader with an explicitly set parent class loader.

## Method Summary

Modifier and Type
Method
Description
`Class`
`defineClass(GeneratedCodeClass cc)`
Define a class based upon a GeneratedCodeClass.
`boolean`
`hasGeneratedClass(String name)`
Discover if a class for this name has already been defined by this class loader.

### Methods inherited from class java.lang.ClassLoader

`clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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