use of groovy.lang.GroovyClassLoader in project ofbiz-framework by apache.
the class GroovyUtil method parseClass.
public static Class<?> parseClass(InputStream in, String location) throws IOException {
GroovyClassLoader groovyClassLoader = new GroovyClassLoader();
Class<?> classLoader = groovyClassLoader.parseClass(UtilIO.readString(in), location);
groovyClassLoader.close();
return classLoader;
}
use of groovy.lang.GroovyClassLoader in project ofbiz-framework by apache.
the class GroovyUtil method parseClass.
public static Class<?> parseClass(String text) throws IOException {
GroovyClassLoader groovyClassLoader = new GroovyClassLoader();
Class<?> classLoader = groovyClassLoader.parseClass(text);
groovyClassLoader.close();
return classLoader;
}
use of groovy.lang.GroovyClassLoader in project midpoint by Evolveum.
the class GroovyScriptEvaluator method getGroovyLoader.
private GroovyClassLoader getGroovyLoader(ScriptExpressionEvaluationContext context) throws SecurityViolationException {
GroovyClassLoader groovyClassLoader = getScriptCache().getInterpreter(context.getExpressionProfile());
if (groovyClassLoader != null) {
return groovyClassLoader;
}
ScriptExpressionProfile scriptExpressionProfile = context.getScriptExpressionProfile();
groovyClassLoader = createGroovyLoader(scriptExpressionProfile, context);
getScriptCache().putInterpreter(context.getExpressionProfile(), groovyClassLoader);
return groovyClassLoader;
}
use of groovy.lang.GroovyClassLoader in project zuul by Netflix.
the class GroovyCompiler method compile.
/**
* Compiles groovy class from a file
*/
public Class<?> compile(File file) throws IOException {
GroovyClassLoader loader = getGroovyClassLoader();
Class<?> groovyClass = loader.parseClass(file);
return groovyClass;
}
use of groovy.lang.GroovyClassLoader in project jbehave-core by jbehave.
the class GroovyAnnotationBuilder method buildConfiguration.
@SuppressWarnings("unchecked")
@Override
public Configuration buildConfiguration() throws AnnotationRequired {
if (annotationFinder().isAnnotationPresent(UsingGroovy.class)) {
Class<GroovyClassLoader> classLoaderClass = annotationFinder().getAnnotatedValue(UsingGroovy.class, Class.class, "classLoader");
Class<GroovyResourceFinder> resourceFinderClass = annotationFinder().getAnnotatedValue(UsingGroovy.class, Class.class, "resourceFinder");
try {
GroovyClassLoader classLoader = super.instanceOf(classLoaderClass, classLoaderClass);
GroovyResourceFinder resourceFinder = super.instanceOf(resourceFinderClass, resourceFinderClass);
context = createGroovyContext(classLoader, resourceFinder);
} catch (Exception e) {
annotationMonitor().elementCreationFailed(GroovyContext.class, e);
}
} else {
annotationMonitor().annotationNotFound(UsingGroovy.class, annotatedClass());
}
return super.buildConfiguration();
}
Aggregations