}
}
private ResourceLoader createResourceLoader() {
try {
ResourceLoader resourceLoader;
if (config.getCompileStrategy() == CompileStrategy.none) {
// 这种情况下,使用自定义的 ResourceLoader
resourceLoader = new CompiledClassResourceLoader();
} else {
resourceLoader = (ResourceLoader) config.getTemplateLoader().newInstance();
}
resourceLoader.initialize(this, config.getTemplatePath(), config.getInputEncoding());
return resourceLoader;
} catch (Exception e) {
throw ExceptionUtils.uncheck(e);
}
}