Class BytecodeGroovyClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- java.security.SecureClassLoader
-
- java.net.URLClassLoader
-
- groovy.lang.GroovyClassLoader
-
- org.jbehave.core.configuration.groovy.BytecodeGroovyClassLoader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class BytecodeGroovyClassLoader extends groovy.lang.GroovyClassLoader
Groovy does not cache the bytecode sequences for generated classes. BytecodeReadingParanamer needs these to get paramater names from classes The Groovy compiler does create the debug tables, and they are the same as the ones made for a native Java class, so this derived GroovyClassLoader fills in for the missing functionality from the base GroovyClassLoader.Groovy allows a mechanism via a system property to force the dump of bytecode to a (temp) directory, but caching the bytecode avoids having to clean up temp directories after the run.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BytecodeGroovyClassLoader.BytecodeClassCollector
-
Constructor Summary
Constructors Constructor Description BytecodeGroovyClassLoader()
-
Method Summary
Modifier and Type Method Description protected groovy.lang.GroovyClassLoader.ClassCollector
createCollector(org.codehaus.groovy.control.CompilationUnit unit, org.codehaus.groovy.control.SourceUnit su)
InputStream
getResourceAsStream(String name)
-
Methods inherited from class groovy.lang.GroovyClassLoader
addClasspath, addURL, clearCache, close, createCompilationUnit, defineClass, defineClass, generateScriptName, getClassCacheEntry, getClassPath, getLoadedClasses, getPermissions, getResourceLoader, getTimeStamp, hasCompatibleConfiguration, isRecompilable, isShouldRecompile, isSourceNewer, loadClass, loadClass, loadClass, loadClass, parseClass, parseClass, parseClass, parseClass, parseClass, parseClass, recompile, removeClassCacheEntry, setClassCacheEntry, setResourceLoader, setShouldRecompile
-
Methods inherited from class java.net.URLClassLoader
definePackage, findClass, findResource, findResources, getURLs, newInstance, newInstance
-
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, 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
-
-
-
-
Method Detail
-
getResourceAsStream
public InputStream getResourceAsStream(String name)
- Overrides:
getResourceAsStream
in classURLClassLoader
-
createCollector
protected groovy.lang.GroovyClassLoader.ClassCollector createCollector(org.codehaus.groovy.control.CompilationUnit unit, org.codehaus.groovy.control.SourceUnit su)
- Overrides:
createCollector
in classgroovy.lang.GroovyClassLoader
-
-