@Internal public class InMemoryByteCodeGroovyClassLoader extends groovy.lang.GroovyClassLoader
GroovyClassLoader
that can be used to test dependency injection compilation.Constructor and Description |
---|
InMemoryByteCodeGroovyClassLoader()
Default constructor.
|
InMemoryByteCodeGroovyClassLoader(ClassLoader loader) |
InMemoryByteCodeGroovyClassLoader(ClassLoader loader,
org.codehaus.groovy.control.CompilerConfiguration config) |
InMemoryByteCodeGroovyClassLoader(ClassLoader parent,
org.codehaus.groovy.control.CompilerConfiguration config,
boolean useConfigurationClasspath) |
InMemoryByteCodeGroovyClassLoader(groovy.lang.GroovyClassLoader parent) |
Modifier and Type | Method and Description |
---|---|
void |
addClass(String name,
byte[] code) |
void |
addService(String name,
Set<String> classes)
Adds one or many services that can be loaded via
ServiceLoader . |
Enumeration<URL> |
findResources(String name) |
Class<?> |
loadClass(String name) |
addClasspath, addURL, clearCache, close, createCollector, createCompilationUnit, defineClass, defineClass, generateScriptName, getClassCacheEntry, getClassPath, getLoadedClasses, getPermissions, getResourceLoader, getTimeStamp, hasCompatibleConfiguration, isRecompilable, isShouldRecompile, isSourceNewer, loadClass, loadClass, loadClass, parseClass, parseClass, parseClass, parseClass, parseClass, parseClass, parseClass, recompile, removeClassCacheEntry, setClassCacheEntry, setResourceLoader, setShouldRecompile
definePackage, findClass, findResource, getResourceAsStream, getURLs, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public InMemoryByteCodeGroovyClassLoader()
public InMemoryByteCodeGroovyClassLoader(ClassLoader loader)
loader
- The ClassLoader
public InMemoryByteCodeGroovyClassLoader(groovy.lang.GroovyClassLoader parent)
parent
- The GroovyClassLoader
public InMemoryByteCodeGroovyClassLoader(ClassLoader parent, org.codehaus.groovy.control.CompilerConfiguration config, boolean useConfigurationClasspath)
parent
- The parent ClassLoader
config
- The CompilerConfiguration
useConfigurationClasspath
- Whether to use the configuration classpathpublic InMemoryByteCodeGroovyClassLoader(ClassLoader loader, org.codehaus.groovy.control.CompilerConfiguration config)
loader
- The ClassLoader
config
- The CompilerConfiguration
public void addClass(String name, byte[] code)
name
- The name of the classcode
- The codepublic void addService(String name, Set<String> classes) throws MalformedURLException
ServiceLoader
.name
- The name of the serviceclasses
- The classesMalformedURLException
- If the name is not validpublic Class<?> loadClass(String name) throws ClassNotFoundException
loadClass
in class groovy.lang.GroovyClassLoader
ClassNotFoundException
public Enumeration<URL> findResources(String name) throws IOException
findResources
in class URLClassLoader
IOException