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

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

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

GroovyClassLoader.setClassCacheEntry介绍

[英]sets an entry in the class cache.
[中]在类缓存中设置一个项。

代码示例

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

removeClassCacheEntry(name);
} else {
  setClassCacheEntry(cls);

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

String clazzName = clazz.getName();
definePackageInternal(clazzName);
setClassCacheEntry(clazz);
if (clazzName.equals(mainClass)) answer = clazz;

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

removeClassCacheEntry(name);
} else {
  setClassCacheEntry(cls);

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

removeClassCacheEntry(name);
} else {
  setClassCacheEntry(cls);

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

removeClassCacheEntry(name);
} else {
  setClassCacheEntry(cls);

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

removeClassCacheEntry(name);
} else {
  setClassCacheEntry(cls);

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

Class clazz = (Class) iter.next();
definePackage(clazz.getName());
setClassCacheEntry(clazz);

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

for (Iterator iter = collector.getLoadedClasses().iterator(); iter.hasNext();) {
  Class clazz = (Class) iter.next();
  setClassCacheEntry(clazz);

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

for (Iterator iter = collector.getLoadedClasses().iterator(); iter.hasNext();) {
  Class clazz = (Class) iter.next();
  setClassCacheEntry(clazz);

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

private Class doParseClass(GroovyCodeSource codeSource) {
  validate(codeSource);
  Class answer;  // Was neither already loaded nor compiling, so compile and add to cache.
  CompilationUnit unit = createCompilationUnit(config, codeSource.getCodeSource());
  SourceUnit su = null;
  if (codeSource.getFile() == null) {
    su = unit.addSource(codeSource.getName(), codeSource.getScriptText());
  } else {
    su = unit.addSource(codeSource.getFile());
  }
  ClassCollector collector = createCollector(unit, su);
  unit.setClassgenCallback(collector);
  int goalPhase = Phases.CLASS_GENERATION;
  if (config != null && config.getTargetDirectory() != null) goalPhase = Phases.OUTPUT;
  unit.compile(goalPhase);
  answer = collector.generatedClass;
  String mainClass = su.getAST().getMainClassName();
  for (Object o : collector.getLoadedClasses()) {
    Class clazz = (Class) o;
    String clazzName = clazz.getName();
    definePackage(clazzName);
    setClassCacheEntry(clazz);
    if (clazzName.equals(mainClass)) answer = clazz;
  }
  return answer;
}

相关文章