Package groovy.lang

Class GroovyClassLoader.InnerLoader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Enclosing class:
    GroovyClassLoader

    public static class GroovyClassLoader.InnerLoader
    extends GroovyClassLoader
    • Method Detail

      • findResource

        public java.net.URL findResource​(java.lang.String name)
        Overrides:
        findResource in class java.net.URLClassLoader
      • findResources

        public java.util.Enumeration findResources​(java.lang.String name)
                                            throws java.io.IOException
        Overrides:
        findResources in class java.net.URLClassLoader
        Throws:
        java.io.IOException
      • getLoadedClasses

        public java.lang.Class[] getLoadedClasses()
        Description copied from class: GroovyClassLoader

        Returns all Groovy classes loaded by this class loader.

        Overrides:
        getLoadedClasses in class GroovyClassLoader
        Returns:
        all classes loaded by this class loader
      • getResource

        public java.net.URL getResource​(java.lang.String name)
        Overrides:
        getResource in class java.lang.ClassLoader
      • getResourceAsStream

        public java.io.InputStream getResourceAsStream​(java.lang.String name)
        Overrides:
        getResourceAsStream in class java.net.URLClassLoader
      • getURLs

        public java.net.URL[] getURLs()
        Overrides:
        getURLs in class java.net.URLClassLoader
      • loadClass

        public java.lang.Class loadClass​(java.lang.String name,
                                         boolean lookupScriptFiles,
                                         boolean preferClassOverScript,
                                         boolean resolve)
                                  throws java.lang.ClassNotFoundException,
                                         CompilationFailedException
        Description copied from class: GroovyClassLoader
        loads a class from a file or a parent classloader.
        Overrides:
        loadClass in class GroovyClassLoader
        Parameters:
        name - of the class to be loaded
        lookupScriptFiles - if false no lookup at files is done at all
        preferClassOverScript - if true the file lookup is only done if there is no class
        resolve - see ClassLoader.loadClass(java.lang.String, boolean)
        Returns:
        the class found or the class created from a file lookup
        Throws:
        java.lang.ClassNotFoundException - if the class could not be found
        CompilationFailedException - if the source file could not be compiled
      • parseClass

        public java.lang.Class parseClass​(GroovyCodeSource codeSource,
                                          boolean shouldCache)
                                   throws CompilationFailedException
        Description copied from class: GroovyClassLoader
        Parses the given code source into a Java class. If there is a class file for the given code source, then no parsing is done, instead the cached class is returned.
        Overrides:
        parseClass in class GroovyClassLoader
        shouldCache - if true then the generated class will be stored in the source cache
        Returns:
        the main class defined in the given script
        Throws:
        CompilationFailedException
      • addURL

        public void addURL​(java.net.URL url)
        Description copied from class: GroovyClassLoader
        adds a URL to the classloader.
        Overrides:
        addURL in class GroovyClassLoader
        Parameters:
        url - the new classpath element
      • getTimeStamp

        public long getTimeStamp()