本文整理了Java中freemarker.template.Configuration.getAutoIncludesWithoutFallback()
方法的一些代码示例,展示了Configuration.getAutoIncludesWithoutFallback()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getAutoIncludesWithoutFallback()
方法的具体详情如下:
包路径:freemarker.template.Configuration
类名称:Configuration
方法名:getAutoIncludesWithoutFallback
暂无
代码示例来源:origin: org.freemarker/freemarker
private void doAutoIncludes(Environment env, Template t) throws TemplateException, IOException,
TemplateNotFoundException, MalformedTemplateNameException, ParseException {
// We can't store autoIncludes in LinkedHashSet-s because setAutoIncludes(List) allows duplicates,
// unfortunately. Yet we have to prevent duplicates among Configuration levels, with the lowest levels having
// priority. So we build some Set-s to do that, but we avoid the most common cases where they aren't needed.
List<String> tAutoIncludes = t.getAutoIncludesWithoutFallback();
List<String> envAutoIncludes = env.getAutoIncludesWithoutFallback();
for (String templateName : getAutoIncludesWithoutFallback()) {
if ((tAutoIncludes == null || !tAutoIncludes.contains(templateName))
&& (envAutoIncludes == null || !envAutoIncludes.contains(templateName))) {
env.include(getTemplate(templateName, env.getLocale()));
}
}
if (tAutoIncludes != null) {
for (String templateName : tAutoIncludes) {
if (envAutoIncludes == null || !envAutoIncludes.contains(templateName)) {
env.include(getTemplate(templateName, env.getLocale()));
}
}
}
if (envAutoIncludes != null) {
for (String templateName : envAutoIncludes) {
env.include(getTemplate(templateName, env.getLocale()));
}
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker
private void doAutoIncludes(Environment env, Template t) throws TemplateException, IOException,
TemplateNotFoundException, MalformedTemplateNameException, ParseException {
// We can't store autoIncludes in LinkedHashSet-s because setAutoIncludes(List) allows duplicates,
// unfortunately. Yet we have to prevent duplicates among Configuration levels, with the lowest levels having
// priority. So we build some Set-s to do that, but we avoid the most common cases where they aren't needed.
List<String> tAutoIncludes = t.getAutoIncludesWithoutFallback();
List<String> envAutoIncludes = env.getAutoIncludesWithoutFallback();
for (String templateName : getAutoIncludesWithoutFallback()) {
if ((tAutoIncludes == null || !tAutoIncludes.contains(templateName))
&& (envAutoIncludes == null || !envAutoIncludes.contains(templateName))) {
env.include(getTemplate(templateName, env.getLocale()));
}
}
if (tAutoIncludes != null) {
for (String templateName : tAutoIncludes) {
if (envAutoIncludes == null || !envAutoIncludes.contains(templateName)) {
env.include(getTemplate(templateName, env.getLocale()));
}
}
}
if (envAutoIncludes != null) {
for (String templateName : envAutoIncludes) {
env.include(getTemplate(templateName, env.getLocale()));
}
}
}
代码示例来源:origin: org.freemarker/freemarker-gae
private void doAutoIncludes(Environment env, Template t) throws TemplateException, IOException,
TemplateNotFoundException, MalformedTemplateNameException, ParseException {
// We can't store autoIncludes in LinkedHashSet-s because setAutoIncludes(List) allows duplicates,
// unfortunately. Yet we have to prevent duplicates among Configuration levels, with the lowest levels having
// priority. So we build some Set-s to do that, but we avoid the most common cases where they aren't needed.
List<String> tAutoIncludes = t.getAutoIncludesWithoutFallback();
List<String> envAutoIncludes = env.getAutoIncludesWithoutFallback();
for (String templateName : getAutoIncludesWithoutFallback()) {
if ((tAutoIncludes == null || !tAutoIncludes.contains(templateName))
&& (envAutoIncludes == null || !envAutoIncludes.contains(templateName))) {
env.include(getTemplate(templateName, env.getLocale()));
}
}
if (tAutoIncludes != null) {
for (String templateName : tAutoIncludes) {
if (envAutoIncludes == null || !envAutoIncludes.contains(templateName)) {
env.include(getTemplate(templateName, env.getLocale()));
}
}
}
if (envAutoIncludes != null) {
for (String templateName : envAutoIncludes) {
env.include(getTemplate(templateName, env.getLocale()));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!