| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| protected final EvictableCache | classCache
this cache contains the loaded classes or PARSING, if the class is currently parsed |
| private final CompilerConfiguration | |
| private static final Class | |
| private static final URL[] | |
| private Boolean | |
| private GroovyResourceLoader | |
| private static int | |
| protected final StampedCommonCache | sourceCache
This cache contains mappings of file name to class. |
| private String |
| Access | Constructor and Description |
|---|---|
| public | GroovyClassLoader()
creates a GroovyClassLoader using the current Thread's context Class loader as parent. |
| public | GroovyClassLoader(ClassLoader loader)
creates a GroovyClassLoader using the given ClassLoader as parent |
| public | GroovyClassLoader(GroovyClassLoader parent)
creates a GroovyClassLoader using the given GroovyClassLoader as parent. |
| public | GroovyClassLoader(ClassLoader
the parent class loader parent, CompilerConfiguration the compiler configuration config, boolean determines if the configurations classpath should be added useConfigurationClasspath)creates a GroovyClassLoader. |
| public | GroovyClassLoader(ClassLoader loader, CompilerConfiguration config)
creates a GroovyClassLoader using the given ClassLoader as parent. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | addURL(URL
the new classpath element url)Overrides java. |
| public void | |
| public void | close()
Overrides java. Implements java. |
| protected GroovyClassLoader. | Returns: the ClassCollectorthe compilationUnit unit, SourceUnit the SourceUnit su)creates a ClassCollector for a new compilation. |
| protected CompilationUnit | Returns: the CompilationUnitthe compiler configuration, usually the same as for this class loader config, CodeSource the source containing the initial file to compile, more files may follow during compilation source)creates a new CompilationUnit. |
| private static String | decodeFileName(String fileName)
This method will take a file name and try to "decode" any URL encoded characters. |
| public Class | Returns: a classLoads the given class node returning the implementation Class. |
| public Class | |
| private void | |
| private Class | |
| private static File | |
| public synchronized String | |
| private String | |
| protected Class | Returns: the class stored for the given nameof the class name)gets a class from the class cache. |
| protected String[] | Returns: a String[] containing the file information of the urlsgets the currently used classpath. |
| private static File | |
| public Class | Returns: all classes loaded by this class loaderReturns all Groovy classes loaded by this class loader. |
| protected PermissionCollection | getPermissions(CodeSource
the codesource codeSource)Overrides java. |
| public GroovyResourceLoader | |
| private URL | |
| protected long | |
| public boolean | Returns: true if the provided config is exactly the same instance
of CompilerConfiguration as this loader hasthe compiler configuration to test for compatibility config)Check if this class loader has compatible |
| private void | |
| private static boolean | |
| protected boolean | Returns: true if the class should be compiled againthe class to be tested. If null the method should return true cls)Indicates if a class is recompilable. |
| public Boolean | |
| protected boolean | Returns: true if the source is newer, false elsethe source we may want to compile source, Class<T> the former class cls)Decides if the given source is newer than a class. |
| public Class | |
| public Class | Returns: the class found or the class created from a file lookupof the class to be loaded name, boolean if false no lookup at files is done at all lookupScriptFiles, boolean if true the file lookup is only done if there is no class preferClassOverScript, boolean resolve)loads a class from a file or a parent classloader. |
| public Class | loadClass(String
The binary name of the class name)Overrides java. |
| protected Class | loadClass(final String
The binary name of the class name, boolean If resolve)true then resolve the classOverrides java. |
| public Class | Returns: the main class defined in the given scriptthe file name to parse file)Parses the given file into a Java class capable of being run |
| public Class | Returns: the main class defined in the given scriptthe text of the script/class to parse text, final String the file name to use as the name of the class fileName)Parses the given text into a Java class capable of being run |
| public Class | Returns: the main class defined in the given scriptthe text of the script/class to parse text)Parses the given text into a Java class capable of being run |
| public Class | |
| public Class | parseClass(final InputStream in, final String fileName)
Deprecated
Prefer using methods taking a Reader rather than an InputStream to avoid wrong encoding issues.
|
| public Class | |
| public Class | Returns: the main class defined in the given scriptif true then the generated class will be stored in the source cache shouldCacheSource)Parses the given code source into a Java class. |
| protected Class | |
| protected void | |
| protected void | |
| public void | |
| public void | |
| private static void |