public static class GroovyClassLoader.InnerLoader extends GroovyClassLoader
GroovyClassLoader.ClassCollector, GroovyClassLoader.InnerLoader
classCache, sourceCache
Constructor and Description |
---|
GroovyClassLoader.InnerLoader(GroovyClassLoader delegate) |
Modifier and Type | Method and Description |
---|---|
void |
addClasspath(String path)
adds a classpath to this classloader.
|
void |
addURL(URL url)
adds a URL to the classloader.
|
void |
clearCache()
Removes all classes from the class cache.
|
URL |
findResource(String name) |
Enumeration |
findResources(String name) |
Class[] |
getLoadedClasses()
Returns all Groovy classes loaded by this class loader.
|
URL |
getResource(String name) |
InputStream |
getResourceAsStream(String name) |
GroovyResourceLoader |
getResourceLoader() |
long |
getTimeStamp() |
URL[] |
getURLs() |
Class |
loadClass(String name,
boolean lookupScriptFiles,
boolean preferClassOverScript,
boolean resolve)
loads a class from a file or a parent classloader.
|
Class |
parseClass(GroovyCodeSource codeSource,
boolean shouldCache)
Parses the given code source into a Java class.
|
void |
setResourceLoader(GroovyResourceLoader resourceLoader) |
createCollector, createCompilationUnit, defineClass, defineClass, generateScriptName, getClassCacheEntry, getClassPath, getPermissions, getTimeStamp, isRecompilable, isShouldRecompile, isSourceNewer, loadClass, loadClass, loadClass, parseClass, parseClass, parseClass, parseClass, parseClass, recompile, removeClassCacheEntry, setClassCacheEntry, setShouldRecompile
close, definePackage, findClass, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public GroovyClassLoader.InnerLoader(GroovyClassLoader delegate)
public void addClasspath(String path)
GroovyClassLoader
addClasspath
in class GroovyClassLoader
path
- is a jar file or a directory.GroovyClassLoader.addURL(URL)
public void clearCache()
GroovyClassLoader
public URL findResource(String name)
findResource
in class URLClassLoader
public Enumeration findResources(String name) throws IOException
findResources
in class URLClassLoader
IOException
public Class[] getLoadedClasses()
GroovyClassLoader
Returns all Groovy classes loaded by this class loader.
getLoadedClasses
in class GroovyClassLoader
public URL getResource(String name)
getResource
in class ClassLoader
public InputStream getResourceAsStream(String name)
getResourceAsStream
in class URLClassLoader
public GroovyResourceLoader getResourceLoader()
getResourceLoader
in class GroovyClassLoader
public URL[] getURLs()
getURLs
in class URLClassLoader
public Class loadClass(String name, boolean lookupScriptFiles, boolean preferClassOverScript, boolean resolve) throws ClassNotFoundException, CompilationFailedException
GroovyClassLoader
loadClass
in class GroovyClassLoader
name
- of the class to be loadedlookupScriptFiles
- if false no lookup at files is done at allpreferClassOverScript
- if true the file lookup is only done if there is no classresolve
- see ClassLoader.loadClass(java.lang.String, boolean)
ClassNotFoundException
- if the class could not be foundCompilationFailedException
- if the source file could not be compiledpublic Class parseClass(GroovyCodeSource codeSource, boolean shouldCache) throws CompilationFailedException
GroovyClassLoader
parseClass
in class GroovyClassLoader
shouldCache
- if true then the generated class will be stored in the source cacheCompilationFailedException
public void setResourceLoader(GroovyResourceLoader resourceLoader)
setResourceLoader
in class GroovyClassLoader
public void addURL(URL url)
GroovyClassLoader
addURL
in class GroovyClassLoader
url
- the new classpath elementpublic long getTimeStamp()