org.webpieces.templatingdev.impl.OurGroovyClassLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http-templating-dev-lib Show documentation
Show all versions of http-templating-dev-lib Show documentation
Templating library using groovy as the scripting language
package org.webpieces.templatingdev.impl;
import java.util.HashSet;
import java.util.Set;
import groovy.lang.GroovyClassLoader;
public class OurGroovyClassLoader extends GroovyClassLoader {
private Set definedClasses = new HashSet<>();
@SuppressWarnings("rawtypes")
@Override
public Class defineClass(String name, byte[] b) {
definedClasses.add(name);
return super.defineClass(name, b, 0, b.length);
}
public boolean isClassDefined(String name) {
return definedClasses.contains(name);
}
}