return Class.forName(name, true, Thread.currentThread().getContextClassLoader());
} catch (ClassNotFoundException e) {
if (types == null) {
types = new HashMap<String, Class<?>>();
}
CompiledVisitor visitor = new CompiledVisitor();
visitor.setResource(resource);
visitor.setNode(root);
visitor.setTypes(types);
visitor.setStream(stream);
visitor.setOffset(offset);
visitor.setDefaultFilterVariable(defaultFilterVariable);
visitor.setDefaultFormatterVariable(defaultFormatterVariable);
visitor.setDefaultVariableType(defaultVariableType);
visitor.setEngineName(engineName);
visitor.setFilterVariable(filterVariable);
visitor.setFormatterSwitcher(formatterSwitcher);
visitor.setFormatterVariable(formatterVariable);
visitor.setForVariable(forVariable);
visitor.setImportMacroTemplates(importMacroTemplates);
visitor.setImportPackages(importPackages);
visitor.setImportPackageSet(importPackageSet);
visitor.setImportSizers(importSizers);
visitor.setImportGetters(importGetters);
visitor.setImportTypes(importTypes);
visitor.setImportMethods(functions);
visitor.setOutputEncoding(outputEncoding);
visitor.setSourceInClass(sourceInClass);
visitor.setTextFilter(textFilter);
visitor.setTextFilterSwitcher(textFilterSwitcher);
visitor.setTextInClass(textInClass);
visitor.setValueFilterSwitcher(valueFilterSwitcher);
visitor.setCompiler(compiler);
visitor.init();
root.accept(visitor);
return visitor.compile();
}
}