use of org.apache.sling.scripting.sightly.compiler.java.utils.CharSequenceJavaCompiler in project sling by apache.
the class JavaClassBackendCompilerTest method render.
private void render(StringWriter writer, ClassInfo classInfo, String source, RenderContext renderContext, Bindings arguments) throws Exception {
ClassLoader classLoader = JavaClassBackendCompilerTest.class.getClassLoader();
CharSequenceJavaCompiler<RenderUnit> compiler = new CharSequenceJavaCompiler<>(classLoader, null);
Class<RenderUnit> newClass = compiler.compile(classInfo.getFullyQualifiedClassName(), source);
RenderUnit renderUnit = newClass.newInstance();
PrintWriter printWriter = new PrintWriter(writer);
renderUnit.render(printWriter, renderContext, arguments);
}
Aggregations