本文整理汇总了Java中freemarker.template.Configuration.setIncompatibleImprovements方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.setIncompatibleImprovements方法的具体用法?Java Configuration.setIncompatibleImprovements怎么用?Java Configuration.setIncompatibleImprovements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类freemarker.template.Configuration
的用法示例。
在下文中一共展示了Configuration.setIncompatibleImprovements方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFreemarkerConfiguration
import freemarker.template.Configuration; //导入方法依赖的package包/类
@Override
protected Configuration getFreemarkerConfiguration(RepoCtx ctx)
{
if (useRemoteCallbacks)
{
// as per 3.0, 3.1
return super.getFreemarkerConfiguration(ctx);
}
else
{
Configuration cfg = new Configuration();
cfg.setObjectWrapper(new DefaultObjectWrapper());
cfg.setTemplateLoader(new ClassPathRepoTemplateLoader(nodeService, contentService, defaultEncoding));
// TODO review i18n
cfg.setLocalizedLookup(false);
cfg.setIncompatibleImprovements(new Version(2, 3, 20));
cfg.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER);
return cfg;
}
}
示例2: getFreemarkerConfiguration
import freemarker.template.Configuration; //导入方法依赖的package包/类
protected Configuration getFreemarkerConfiguration(RepoCtx ctx)
{
Configuration cfg = new Configuration();
cfg.setObjectWrapper(new DefaultObjectWrapper());
// custom template loader
cfg.setTemplateLoader(new TemplateWebScriptLoader(ctx.getRepoEndPoint(), ctx.getTicket()));
// TODO review i18n
cfg.setLocalizedLookup(false);
cfg.setIncompatibleImprovements(new Version(2, 3, 20));
cfg.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER);
return cfg;
}
示例3: getStringConfig
import freemarker.template.Configuration; //导入方法依赖的package包/类
/**
* FreeMarker configuration for loading the specified template directly from a String
*
* @param path Pseudo Path to the template
* @param template Template content
*
* @return FreeMarker configuration
*/
protected Configuration getStringConfig(String path, String template)
{
Configuration config = new Configuration();
// setup template cache
config.setCacheStorage(new MruCacheStorage(2, 0));
// use our custom loader to load a template directly from a String
StringTemplateLoader stringTemplateLoader = new StringTemplateLoader();
stringTemplateLoader.putTemplate(path, template);
config.setTemplateLoader(stringTemplateLoader);
// use our custom object wrapper that can deal with QNameMap objects directly
config.setObjectWrapper(qnameObjectWrapper);
// rethrow any exception so we can deal with them
config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
// set default template encoding
if (defaultEncoding != null)
{
config.setDefaultEncoding(defaultEncoding);
}
config.setIncompatibleImprovements(new Version(2, 3, 20));
config.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER);
return config;
}