Package io.micronaut.ast.groovy.utils
Class InMemoryByteCodeGroovyClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
groovy.lang.GroovyClassLoader
io.micronaut.ast.groovy.utils.InMemoryByteCodeGroovyClassLoader
- All Implemented Interfaces:
- Closeable,- AutoCloseable
Extended version of 
GroovyClassLoader that can be used to test dependency injection compilation.- Since:
- 1.0
- Author:
- graemerocher
- 
Nested Class SummaryNested classes/interfaces inherited from class groovy.lang.GroovyClassLoadergroovy.lang.GroovyClassLoader.ClassCollector, groovy.lang.GroovyClassLoader.InnerLoader
- 
Field SummaryFields inherited from class groovy.lang.GroovyClassLoaderclassCache, sourceCache
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor.InMemoryByteCodeGroovyClassLoader(groovy.lang.GroovyClassLoader parent) InMemoryByteCodeGroovyClassLoader(ClassLoader loader, org.codehaus.groovy.control.CompilerConfiguration config) InMemoryByteCodeGroovyClassLoader(ClassLoader parent, org.codehaus.groovy.control.CompilerConfiguration config, boolean useConfigurationClasspath) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidaddService(String name, Set<String> classes) Adds one or many services that can be loaded viaServiceLoader.findResources(String name) Class<?>Methods inherited from class groovy.lang.GroovyClassLoaderaddClasspath, addURL, clearCache, close, createCollector, createCompilationUnit, defineClass, defineClass, genEncodingString, generateScriptName, getClassCacheEntry, getClassPath, getLoadedClasses, getPermissions, getResourceLoader, getTimeStamp, hasCompatibleConfiguration, isRecompilable, isShouldRecompile, isSourceNewer, loadClass, loadClass, loadClass, parseClass, parseClass, parseClass, parseClass, parseClass, parseClass, recompile, removeClassCacheEntry, setClassCacheEntry, setResourceLoader, setShouldRecompileMethods inherited from class java.net.URLClassLoaderdefinePackage, findClass, findResource, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoaderdefineClass, defineClassMethods inherited from class java.lang.ClassLoaderclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
- 
Constructor Details- 
InMemoryByteCodeGroovyClassLoaderpublic InMemoryByteCodeGroovyClassLoader()Default constructor.
- 
InMemoryByteCodeGroovyClassLoader- Parameters:
- loader- The- ClassLoader
 
- 
InMemoryByteCodeGroovyClassLoaderpublic InMemoryByteCodeGroovyClassLoader(groovy.lang.GroovyClassLoader parent) - Parameters:
- parent- The- GroovyClassLoader
 
- 
InMemoryByteCodeGroovyClassLoaderpublic InMemoryByteCodeGroovyClassLoader(ClassLoader parent, org.codehaus.groovy.control.CompilerConfiguration config, boolean useConfigurationClasspath) - Parameters:
- parent- The parent- ClassLoader
- config- The- CompilerConfiguration
- useConfigurationClasspath- Whether to use the configuration classpath
 
- 
InMemoryByteCodeGroovyClassLoaderpublic InMemoryByteCodeGroovyClassLoader(ClassLoader loader, org.codehaus.groovy.control.CompilerConfiguration config) - Parameters:
- loader- The- ClassLoader
- config- The- CompilerConfiguration
 
 
- 
- 
Method Details- 
addClass- Parameters:
- name- The name of the class
- code- The code
 
- 
addServiceAdds one or many services that can be loaded viaServiceLoader.- Parameters:
- name- The name of the service
- classes- The classes
- Throws:
- MalformedURLException- If the name is not valid
 
- 
loadClass- Overrides:
- loadClassin class- groovy.lang.GroovyClassLoader
- Throws:
- ClassNotFoundException
 
- 
findResources- Overrides:
- findResourcesin class- URLClassLoader
- Throws:
- IOException
 
- 
getGeneratedClasses
 
-