本文整理了Java中freemarker.template.Configuration.getTemplateNameFormat()
方法的一些代码示例,展示了Configuration.getTemplateNameFormat()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getTemplateNameFormat()
方法的具体详情如下:
包路径:freemarker.template.Configuration
类名称:Configuration
方法名:getTemplateNameFormat
[英]The getter pair of #setTemplateNameFormat(TemplateNameFormat).
[中]#setTemplateNameFormat(TemplateNameFormat)的getter对。
代码示例来源:origin: org.freemarker/freemarker
/**
* Converts a root based name (a name that's either relative to the root, or is absolute), which are typically used
* by the API (such as for {@link Configuration#getTemplate(String)}), to an absolute name, which can be safely
* passed to {@code <#include path>} and such, as it won't be misinterpreted to be relative to the directory of the
* template. For example, {@code "foo/bar.ftl"} is converted to {@code "/foo/bar.ftl"}, while {@code "/foo/bar"} or
* {@code "foo://bar/baz"} remains as is, as they are already absolute names (see {@link TemplateNameFormat} for
* more about the format of names).
*
* <p>
* You only need this if the template name will be passed to {@code <#include name>}, {@code <#import name>},
* {@code .get_optional_template(name)} or a similar construct in a template, otherwise using non-absolute root
* based names is fine.
*
* @since 2.3.28
*/
public String rootBasedToAbsoluteTemplateName(String rootBasedName) throws MalformedTemplateNameException {
return _CacheAPI.rootBasedNameToAbsoluteName(configuration.getTemplateNameFormat(), rootBasedName);
}
代码示例来源:origin: org.freemarker/freemarker
return _CacheAPI.toRootBasedName(configuration.getTemplateNameFormat(), baseName, targetName);
代码示例来源:origin: org.freemarker/freemarker
TemplateNameFormat tnf = getConfiguration().getTemplateNameFormat();
templateName = _CacheAPI.normalizeRootBasedName(tnf, templateName);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker
/**
* Converts a root based name (a name that's either relative to the root, or is absolute), which are typically used
* by the API (such as for {@link Configuration#getTemplate(String)}), to an absolute name, which can be safely
* passed to {@code <#include path>} and such, as it won't be misinterpreted to be relative to the directory of the
* template. For example, {@code "foo/bar.ftl"} is converted to {@code "/foo/bar.ftl"}, while {@code "/foo/bar"} or
* {@code "foo://bar/baz"} remains as is, as they are already absolute names (see {@link TemplateNameFormat} for
* more about the format of names).
*
* <p>
* You only need this if the template name will be passed to {@code <#include name>}, {@code <#import name>},
* {@code .get_optional_template(name)} or a similar construct in a template, otherwise using non-absolute root
* based names is fine.
*
* @since 2.3.28
*/
public String rootBasedToAbsoluteTemplateName(String rootBasedName) throws MalformedTemplateNameException {
return _CacheAPI.rootBasedNameToAbsoluteName(configuration.getTemplateNameFormat(), rootBasedName);
}
代码示例来源:origin: org.freemarker/freemarker-gae
/**
* Converts a root based name (a name that's either relative to the root, or is absolute), which are typically used
* by the API (such as for {@link Configuration#getTemplate(String)}), to an absolute name, which can be safely
* passed to {@code <#include path>} and such, as it won't be misinterpreted to be relative to the directory of the
* template. For example, {@code "foo/bar.ftl"} is converted to {@code "/foo/bar.ftl"}, while {@code "/foo/bar"} or
* {@code "foo://bar/baz"} remains as is, as they are already absolute names (see {@link TemplateNameFormat} for
* more about the format of names).
*
* <p>
* You only need this if the template name will be passed to {@code <#include name>}, {@code <#import name>},
* {@code .get_optional_template(name)} or a similar construct in a template, otherwise using non-absolute root
* based names is fine.
*
* @since 2.3.28
*/
public String rootBasedToAbsoluteTemplateName(String rootBasedName) throws MalformedTemplateNameException {
return _CacheAPI.rootBasedNameToAbsoluteName(configuration.getTemplateNameFormat(), rootBasedName);
}
代码示例来源:origin: org.freemarker/freemarker-gae
return _CacheAPI.toRootBasedName(configuration.getTemplateNameFormat(), baseName, targetName);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker
return _CacheAPI.toRootBasedName(configuration.getTemplateNameFormat(), baseName, targetName);
代码示例来源:origin: org.freemarker/freemarker-gae
TemplateNameFormat tnf = getConfiguration().getTemplateNameFormat();
templateName = _CacheAPI.normalizeRootBasedName(tnf, templateName);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker
TemplateNameFormat tnf = getConfiguration().getTemplateNameFormat();
templateName = _CacheAPI.normalizeRootBasedName(tnf, templateName);
内容来源于网络,如有侵权,请联系作者删除!