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

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

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

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();

相关文章