Package org.codehaus.groovy.reflection

# Class ClassLoaderForClassArtifacts

java.lang.Object
java.lang.ClassLoader
org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts

Direct Known Subclasses:
  `CallSiteClassLoader`

public class ClassLoaderForClassArtifacts extends ClassLoader

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final SoftReference<Class>`
  `klazz`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ClassLoaderForClassArtifacts(Class klazz)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `createClassName(Method method)`
  `String`
  `createClassName(String methodName)`
  `Class`
  `define(String name, byte[] bytes)`
  `Constructor`
  `defineClassAndGetConstructor(String name, byte[] bytes, Class<?>... parameterTypes)`
  Defines a class from bytecode and returns a constructor matching `parameterTypes`.
  `Class`
  `loadClass(String name)`

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

- ## Field Details

  - ### klazz

    public final SoftReference<Class> klazz

- ## Constructor Details

  - ### ClassLoaderForClassArtifacts

    public ClassLoaderForClassArtifacts(Class klazz)

- ## Method Details

  - ### define

    public Class define(String name, byte[] bytes)

  - ### loadClass

    public Class loadClass(String name) throws ClassNotFoundException
    Overrides:
      `loadClass` in class `ClassLoader`
    Throws:
      `ClassNotFoundException`

  - ### createClassName

    public String createClassName(Method method)

  - ### createClassName

    public String createClassName(String methodName)

  - ### defineClassAndGetConstructor

    public Constructor defineClassAndGetConstructor(String name, byte[] bytes, Class<?>... parameterTypes)
    Defines a class from bytecode and returns a constructor matching `parameterTypes`.
    Parameters:
      `name` - the binary name of the class to define
      `bytes` - the class file bytes
      `parameterTypes` - the constructor parameter types to look up
    Returns:
      the matching constructor, or `null` if definition or lookup fails