public Class loadClass( String name, boolean lookupScriptFiles, boolean preferClassOverScript, boolean resolve) throws ClassNotFoundException, CompilationFailedException { Class c = findLoadedClass(name); if (c != null) return c; return delegate.loadClass(name, lookupScriptFiles, preferClassOverScript, resolve); }
protected Class createClass(byte[] code, ClassNode classNode) { BytecodeProcessor bytecodePostprocessor = unit.getConfiguration().getBytecodePostprocessor(); byte[] fcode = code; if (bytecodePostprocessor != null) { fcode = bytecodePostprocessor.processBytecode(classNode.getName(), fcode); } GroovyClassLoader cl = getDefiningClassLoader(); Class theClass = cl.defineClass( classNode.getName(), fcode, 0, fcode.length, unit.getAST().getCodeSource()); this.loadedClasses.add(theClass); if (generatedClass == null) { ModuleNode mn = classNode.getModule(); SourceUnit msu = null; if (mn != null) msu = mn.getContext(); ClassNode main = null; if (mn != null) main = (ClassNode) mn.getClasses().get(0); if (msu == su && main == classNode) generatedClass = theClass; } return theClass; }
public void addURL(URL url) { delegate.addURL(url); }
public void setResourceLoader(GroovyResourceLoader resourceLoader) { delegate.setResourceLoader(resourceLoader); }
public Class parseClass(GroovyCodeSource codeSource, boolean shouldCache) throws CompilationFailedException { return delegate.parseClass(codeSource, shouldCache); }
public GroovyResourceLoader getResourceLoader() { return delegate.getResourceLoader(); }
public URL[] getURLs() { return delegate.getURLs(); }
public URL getResource(String name) { return delegate.getResource(name); }
public InputStream getResourceAsStream(String name) { return delegate.getResourceAsStream(name); }
public Class[] getLoadedClasses() { return delegate.getLoadedClasses(); }
public Enumeration findResources(String name) throws IOException { return delegate.findResources(name); }
public URL findResource(String name) { return delegate.findResource(name); }
public void clearCache() { delegate.clearCache(); }
public void addClasspath(String path) { delegate.addClasspath(path); }