Class GeneratedClassLoader


  • public class GeneratedClassLoader
    extends java.lang.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​(java.lang.ClassLoader parent)
      Create a new loader with an explicitly set parent class loader.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class defineClass​(GeneratedCodeClass cc)
      Define a class based upon a GeneratedCodeClass.
      boolean hasGeneratedClass​(java.lang.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 Detail

      • GeneratedClassLoader

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

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

      • defineClass

        public java.lang.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​(java.lang.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