Package groovy.lang

Examples of groovy.lang.GroovyResourceLoader


            }
        }

        GroovyClassLoader loader = new GroovyClassLoader(parent, configuration);
        // in command line we don't need to do script lookups
        loader.setResourceLoader(new GroovyResourceLoader() {
            public URL loadGroovySource(String filename) throws MalformedURLException {
                return null;
            }
        });
View Full Code Here


        } else {
            unit = new CompilationUnit(configuration);
        }

        // in command line we don't need to do script lookups
        unit.getClassLoader().setResourceLoader(new GroovyResourceLoader() {
            public URL loadGroovySource(String filename) throws MalformedURLException {
                return null;
            }
        });
    }
View Full Code Here

            super(loader);
            setResLoader();
        }

        private void setResLoader() {
            final GroovyResourceLoader rl = getResourceLoader();
            setResourceLoader(new GroovyResourceLoader() {
                public URL loadGroovySource(String className) throws MalformedURLException {
                  String filename;
                  for (String extension : getConfig().getScriptExtensions()) {
                        filename = className.replace('.', File.separatorChar) + "." + extension;
                    try {
                        URLConnection dependentScriptConn = rc.getResourceConnection(filename);
                        return dependentScriptConn.getURL();
                    } catch (ResourceException e) {
                        //TODO: maybe do something here?
                    }
                  }
                    return rl.loadGroovySource(className);
                }
            });
        }
View Full Code Here

            }
        }

        GroovyClassLoader loader = new GroovyClassLoader(parent, configuration);
        // in command line we don't need to do script lookups
        loader.setResourceLoader(new GroovyResourceLoader() {
            public URL loadGroovySource(String filename) throws MalformedURLException {
                return null;
            }
        });
View Full Code Here

            super(loader);
            setResLoader();
        }

        private void setResLoader() {
            final GroovyResourceLoader rl = getResourceLoader();
            setResourceLoader(new GroovyResourceLoader() {
                public URL loadGroovySource(String className) throws MalformedURLException {
                  String filename;
                  for (String extension : getConfig().getScriptExtensions()) {
                        filename = className.replace('.', File.separatorChar) + "." + extension;
                    try {
                        URLConnection dependentScriptConn = rc.getResourceConnection(filename);
                        return dependentScriptConn.getURL();
                    } catch (ResourceException e) {
                        //TODO: maybe do something here?
                    }
                  }
                    return rl.loadGroovySource(className);
                }
            });
        }
View Full Code Here

        } else {
            unit = new CompilationUnit(configuration);
        }

        // in command line we don't need to do script lookups
        unit.getClassLoader().setResourceLoader(new GroovyResourceLoader() {
            public URL loadGroovySource(String filename) throws MalformedURLException {
                return null;
            }
        });
    }
View Full Code Here

        }

        GroovyClassLoader loader = new GroovyClassLoader(parent, configuration);
        if (!forceLookupUnnamedFiles) {
            // in normal case we don't need to do script lookups
            loader.setResourceLoader(new GroovyResourceLoader() {
                public URL loadGroovySource(String filename) throws MalformedURLException {
                    return null;
                }
            });
        }
View Full Code Here

                        URL url = file.getAbsoluteFile().getParentFile().toURI().toURL();
                        compiler.unit.getClassLoader().addURL(url);
                    }
                }
            } else {
                compiler.unit.getClassLoader().setResourceLoader(new GroovyResourceLoader() {
                    public URL loadGroovySource(String filename) throws MalformedURLException {
                        return null;
                    }
                });
            }
View Full Code Here

            super(loader, config, false);
            setResLoader();
        }

        private void setResLoader() {
            final GroovyResourceLoader rl = getResourceLoader();
            setResourceLoader(new GroovyResourceLoader() {
                public URL loadGroovySource(String className) throws MalformedURLException {
                    String filename;
                    for (String extension : getConfig().getScriptExtensions()) {
                        filename = className.replace('.', File.separatorChar) + "." + extension;
                        try {
                            URLConnection dependentScriptConn = rc.getResourceConnection(filename);
                            return dependentScriptConn.getURL();
                        } catch (ResourceException e) {
                            //TODO: maybe do something here?
                        }
                    }
                    return rl.loadGroovySource(className);
                }
            });
        }
View Full Code Here

            }
        }

        GroovyClassLoader loader = new GroovyClassLoader(parent, configuration);
        // in command line we don't need to do script lookups
        loader.setResourceLoader(new GroovyResourceLoader() {
            public URL loadGroovySource(String filename) throws MalformedURLException {
                return null;
            }
        });
View Full Code Here

TOP

Related Classes of groovy.lang.GroovyResourceLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.