public static class GroovyClassLoader.InnerLoader extends GroovyClassLoader
GroovyClassLoader.ClassCollector, GroovyClassLoader.InnerLoader
classCache, sourceCache
Constructor and Description |
---|
InnerLoader(GroovyClassLoader delegate) |
Modifier and Type | Method and Description |
---|---|
void |
addClasspath(java.lang.String path)
adds a classpath to this classloader.
|
void |
addURL(java.net.URL url)
adds a URL to the classloader.
|
void |
clearCache()
Removes all classes from the class cache.
|
java.net.URL |
findResource(java.lang.String name) |
java.util.Enumeration |
findResources(java.lang.String name) |
java.lang.Class[] |
getLoadedClasses()
Returns all Groovy classes loaded by this class loader.
|
java.net.URL |
getResource(java.lang.String name) |
java.io.InputStream |
getResourceAsStream(java.lang.String name) |
GroovyResourceLoader |
getResourceLoader() |
long |
getTimeStamp() |
java.net.URL[] |
getURLs() |
java.lang.Class |
loadClass(java.lang.String name,
boolean lookupScriptFiles,
boolean preferClassOverScript,
boolean resolve)
loads a class from a file or a parent classloader.
|
java.lang.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
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 InnerLoader(GroovyClassLoader delegate)
public void addClasspath(java.lang.String path)
GroovyClassLoader
addClasspath
in class GroovyClassLoader
path
- is a jar file or a directory.GroovyClassLoader.addURL(URL)
public void clearCache()
GroovyClassLoader
public java.net.URL findResource(java.lang.String name)
findResource
in class java.net.URLClassLoader
public java.util.Enumeration findResources(java.lang.String name) throws java.io.IOException
findResources
in class java.net.URLClassLoader
java.io.IOException
public java.lang.Class[] getLoadedClasses()
GroovyClassLoader
Returns all Groovy classes loaded by this class loader.
getLoadedClasses
in class GroovyClassLoader
public java.net.URL getResource(java.lang.String name)
getResource
in class java.lang.ClassLoader
public java.io.InputStream getResourceAsStream(java.lang.String name)
getResourceAsStream
in class java.net.URLClassLoader
public GroovyResourceLoader getResourceLoader()
getResourceLoader
in class GroovyClassLoader
public java.net.URL[] getURLs()
getURLs
in class java.net.URLClassLoader
public java.lang.Class loadClass(java.lang.String name, boolean lookupScriptFiles, boolean preferClassOverScript, boolean resolve) throws java.lang.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)
java.lang.ClassNotFoundException
- if the class could not be foundCompilationFailedException
- if the source file could not be compiledpublic java.lang.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(java.net.URL url)
GroovyClassLoader
addURL
in class GroovyClassLoader
url
- the new classpath elementpublic long getTimeStamp()