本文整理了Java中groovy.lang.GroovyClassLoader.getResourceLoader()
方法的一些代码示例,展示了GroovyClassLoader.getResourceLoader()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GroovyClassLoader.getResourceLoader()
方法的具体详情如下:
包路径:groovy.lang.GroovyClassLoader
类名称:GroovyClassLoader
方法名:getResourceLoader
暂无
代码示例来源:origin: org.codehaus.groovy/groovy
public GroovyResourceLoader getResourceLoader() {
return delegate.getResourceLoader();
}
代码示例来源:origin: org.codehaus.groovy/groovy
/**
* try to find a script using the compilation unit class loader.
*/
private static LookupResult tryAsScript(String name, CompilationUnit compilationUnit, ClassNode oldClass) {
LookupResult lr = null;
if (oldClass!=null) {
lr = new LookupResult(null, oldClass);
}
if (name.startsWith("java.")) return lr;
//TODO: don't ignore inner static classes completely
if (name.indexOf('$') != -1) return lr;
// try to find a script from classpath*/
GroovyClassLoader gcl = compilationUnit.getClassLoader();
URL url = null;
try {
url = gcl.getResourceLoader().loadGroovySource(name);
} catch (MalformedURLException e) {
// fall through and let the URL be null
}
if (url != null && ( oldClass==null || isSourceNewer(url, oldClass))) {
SourceUnit su = compilationUnit.addSource(url);
return new LookupResult(su,null);
}
return lr;
}
代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal
public GroovyResourceLoader getResourceLoader() {
return delegate.getResourceLoader();
}
代码示例来源:origin: org.codehaus.groovy/groovy-jdk14
public GroovyResourceLoader getResourceLoader() {
return delegate.getResourceLoader();
}
代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm
public GroovyResourceLoader getResourceLoader() {
return delegate.getResourceLoader();
}
代码示例来源:origin: org.kohsuke.droovy/groovy
public GroovyResourceLoader getResourceLoader() {
return delegate.getResourceLoader();
}
代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm
/**
* try to find a script using the compilation unit class loader.
*/
private LookupResult tryAsScript(String name, CompilationUnit compilationUnit, Class oldClass) {
LookupResult lr = null;
if (oldClass!=null) {
ClassNode cn = ClassHelper.make(oldClass);
lr = new LookupResult(null,cn);
}
if (name.startsWith("java.")) return lr;
//TODO: don't ignore inner static classes completely
if (name.indexOf('$') != -1) return lr;
// try to find a script from classpath*/
GroovyClassLoader gcl = compilationUnit.getClassLoader();
URL url = null;
try {
url = gcl.getResourceLoader().loadGroovySource(name);
} catch (MalformedURLException e) {
// fall through and let the URL be null
}
if (url != null && ( oldClass==null || isSourceNewer(url, oldClass))) {
SourceUnit su = compilationUnit.addSource(url);
return new LookupResult(su,null);
}
return lr;
}
代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal
URL url = null;
try {
url = gcl.getResourceLoader().loadGroovySource(name);
} catch (MalformedURLException e) {
代码示例来源:origin: org.kohsuke.droovy/groovy
URL url = null;
try {
url = gcl.getResourceLoader().loadGroovySource(name);
} catch (MalformedURLException e) {
代码示例来源:origin: org.codehaus.groovy/groovy-jdk14
URL url = null;
try {
url = gcl.getResourceLoader().loadGroovySource(name);
} catch (MalformedURLException e) {
内容来源于网络,如有侵权,请联系作者删除!