本文整理了Java中groovy.lang.GroovyClassLoader.isSourceNewer()
方法的一些代码示例,展示了GroovyClassLoader.isSourceNewer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GroovyClassLoader.isSourceNewer()
方法的具体详情如下:
包路径:groovy.lang.GroovyClassLoader
类名称:GroovyClassLoader
方法名:isSourceNewer
[英]Decides if the given source is newer than a class.
[中]
代码示例来源:origin: org.codehaus.groovy/groovy
if (source != null) {
if (oldClass == null || isSourceNewer(source, oldClass)) {
String name = source.toExternalForm();
代码示例来源:origin: org.codehaus.groovy/groovy-jdk14
/**
* (Re)Compiles the given source.
* This method starts the compilation of a given source, if
* the source has changed since the class was created. For
* this isSourceNewer is called.
*
* @param source the source pointer for the compilation
* @param className the name of the class to be generated
* @param oldClass a possible former class
* @return the old class if the source wasn't new enough, the new class else
* @throws CompilationFailedException if the compilation failed
* @throws IOException if the source is not readable
* @see #isSourceNewer(URL, Class)
*/
protected Class recompile(URL source, String className, Class oldClass) throws CompilationFailedException, IOException {
if (source != null) {
// found a source, compile it if newer
if ((oldClass != null && isSourceNewer(source, oldClass)) || (oldClass == null)) {
sourceCache.remove(className);
return parseClass(source.openStream(), className);
}
}
return oldClass;
}
代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal
/**
* (Re)Compiles the given source.
* This method starts the compilation of a given source, if
* the source has changed since the class was created. For
* this isSourceNewer is called.
*
* @param source the source pointer for the compilation
* @param className the name of the class to be generated
* @param oldClass a possible former class
* @return the old class if the source wasn't new enough, the new class else
* @throws CompilationFailedException if the compilation failed
* @throws IOException if the source is not readable
* @see #isSourceNewer(URL, Class)
*/
protected Class recompile(URL source, String className, Class oldClass) throws CompilationFailedException, IOException {
if (source != null) {
// found a source, compile it if newer
if ((oldClass != null && isSourceNewer(source, oldClass)) || (oldClass == null)) {
sourceCache.remove(className);
return parseClass(source.openStream(), className);
}
}
return oldClass;
}
代码示例来源:origin: org.kohsuke.droovy/groovy
/**
* (Re)Compiles the given source.
* This method starts the compilation of a given source, if
* the source has changed since the class was created. For
* this isSourceNewer is called.
*
* @param source the source pointer for the compilation
* @param className the name of the class to be generated
* @param oldClass a possible former class
* @return the old class if the source wasn't new enough, the new class else
* @throws CompilationFailedException if the compilation failed
* @throws IOException if the source is not readable
* @see #isSourceNewer(URL, Class)
*/
protected Class recompile(URL source, String className, Class oldClass) throws CompilationFailedException, IOException {
if (source != null) {
// found a source, compile it if newer
if ((oldClass != null && isSourceNewer(source, oldClass)) || (oldClass == null)) {
sourceCache.remove(className);
return parseClass(source.openStream(), className);
}
}
return oldClass;
}
代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm
if (source != null) {
if ((oldClass != null && isSourceNewer(source, oldClass)) || (oldClass == null)) {
synchronized (sourceCache) {
String name = source.toExternalForm();
内容来源于网络,如有侵权,请联系作者删除!