groovy.lang.GroovyClassLoader.isRecompilable()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中groovy.lang.GroovyClassLoader.isRecompilable()方法的一些代码示例,展示了GroovyClassLoader.isRecompilable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GroovyClassLoader.isRecompilable()方法的具体详情如下:
包路径:groovy.lang.GroovyClassLoader
类名称:GroovyClassLoader
方法名:isRecompilable

GroovyClassLoader.isRecompilable介绍

[英]Indicates if a class is recompilable. Recompileable means, that the classloader will try to locate a groovy source file for this class and then compile it again, adding the resulting class as entry to the cache. Giving null as class is like a recompilation, so the method should always return true here. Only classes that are implementing GroovyObject are compileable and only if the timestamp in the class is lower than Long.MAX_VALUE.

NOTE: First the parent loaders will be asked and only if they don't return a class the recompilation will happen. Recompilation also only happen if the source file is newer.
[中]指示类是否可重新编译。可重新编译意味着,类加载器将尝试定位该类的groovy源文件,然后再次编译它,将生成的类作为条目添加到缓存中。将null指定为类类似于重新编译,因此该方法在这里应始终返回true。只有实现GroovyObject的类才是可编译的,并且只有当类中的时间戳小于Long时才是可编译的。最大值。
注意:首先会询问父加载程序,只有当它们不返回类时,才会进行重新编译。仅当源文件较新时,才会发生重新编译。

代码示例

代码示例来源:origin: org.codehaus.groovy/groovy

boolean recompile = isRecompilable(cls);
if (!recompile) return cls;

代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal

boolean recompile = isRecompilable(cls);
if (!recompile) return cls;

代码示例来源:origin: org.kohsuke.droovy/groovy

boolean recompile = isRecompilable(cls);
if (!recompile) return cls;

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

boolean recompile = isRecompilable(cls);
if (!recompile) return cls;

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

boolean recompile = isRecompilable(cls);
if (!recompile) return cls;

相关文章