freemarker.template.Configuration.setTemplateConfigurations()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(161)

本文整理了Java中freemarker.template.Configuration.setTemplateConfigurations()方法的一些代码示例,展示了Configuration.setTemplateConfigurations()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.setTemplateConfigurations()方法的具体详情如下:
包路径:freemarker.template.Configuration
类名称:Configuration
方法名:setTemplateConfigurations

Configuration.setTemplateConfigurations介绍

[英]Sets a TemplateConfigurationFactory that will configure individual templates where their settings differ from those coming from the common Configuration object. A typical use case for that is specifying the TemplateConfiguration#setOutputFormat(OutputFormat) for templates based on their file extension or parent directory.

Note that the settings suggested by standard file extensions are stronger than that you set here. See #setRecognizeStandardFileExtensions(boolean) for more information about standard file extensions.

See "Template configurations" in the FreeMarker Manual for examples.
[中]设置TemplateConfigurationFactory,该工厂将配置各个模板,其中这些模板的设置不同于来自公共配置对象的模板。这方面的一个典型用例是根据模板的文件扩展名或父目录指定模板的TemplateConfiguration#setOutputFormat(OutputFormat)。
请注意,标准文件扩展名建议的设置比您在此处设置的设置更强大。有关标准文件扩展名的更多信息,请参见#设置识别标准文件扩展名(布尔值)。
有关示例,请参阅FreeMarker手册中的“模板配置”。

代码示例

代码示例来源:origin: org.freemarker/freemarker

|| TEMPLATE_CONFIGURATIONS_KEY_CAMEL_CASE.equals(name)) {
if (value.equals(NULL)) {
  setTemplateConfigurations(null);
} else {
  setTemplateConfigurations((TemplateConfigurationFactory) _ObjectBuilderSettingEvaluator.eval(
      value, TemplateConfigurationFactory.class, false, _SettingEvaluationEnvironment.getCurrent()));

代码示例来源:origin: net.sourceforge.fmpp/fmpp

fmCfg.setTemplateConfigurations(new FMPPTemplateConfigurationFactory());

代码示例来源:origin: org.freemarker/freemarker-gae

|| TEMPLATE_CONFIGURATIONS_KEY_CAMEL_CASE.equals(name)) {
if (value.equals(NULL)) {
  setTemplateConfigurations(null);
} else {
  setTemplateConfigurations((TemplateConfigurationFactory) _ObjectBuilderSettingEvaluator.eval(
      value, TemplateConfigurationFactory.class, false, _SettingEvaluationEnvironment.getCurrent()));

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker

|| TEMPLATE_CONFIGURATIONS_KEY_CAMEL_CASE.equals(name)) {
if (value.equals(NULL)) {
  setTemplateConfigurations(null);
} else {
  setTemplateConfigurations((TemplateConfigurationFactory) _ObjectBuilderSettingEvaluator.eval(
      value, TemplateConfigurationFactory.class, false, _SettingEvaluationEnvironment.getCurrent()));

相关文章

Configuration类方法