freemarker.core.Environment.getAutoIncludesWithoutFallback()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(115)

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

Environment.getAutoIncludesWithoutFallback介绍

暂无

代码示例

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

  1. private void doAutoIncludes(Environment env, Template t) throws TemplateException, IOException,
  2. TemplateNotFoundException, MalformedTemplateNameException, ParseException {
  3. // We can't store autoIncludes in LinkedHashSet-s because setAutoIncludes(List) allows duplicates,
  4. // unfortunately. Yet we have to prevent duplicates among Configuration levels, with the lowest levels having
  5. // priority. So we build some Set-s to do that, but we avoid the most common cases where they aren't needed.
  6. List<String> tAutoIncludes = t.getAutoIncludesWithoutFallback();
  7. List<String> envAutoIncludes = env.getAutoIncludesWithoutFallback();
  8. for (String templateName : getAutoIncludesWithoutFallback()) {
  9. if ((tAutoIncludes == null || !tAutoIncludes.contains(templateName))
  10. && (envAutoIncludes == null || !envAutoIncludes.contains(templateName))) {
  11. env.include(getTemplate(templateName, env.getLocale()));
  12. }
  13. }
  14. if (tAutoIncludes != null) {
  15. for (String templateName : tAutoIncludes) {
  16. if (envAutoIncludes == null || !envAutoIncludes.contains(templateName)) {
  17. env.include(getTemplate(templateName, env.getLocale()));
  18. }
  19. }
  20. }
  21. if (envAutoIncludes != null) {
  22. for (String templateName : envAutoIncludes) {
  23. env.include(getTemplate(templateName, env.getLocale()));
  24. }
  25. }
  26. }

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

  1. private void doAutoIncludes(Environment env, Template t) throws TemplateException, IOException,
  2. TemplateNotFoundException, MalformedTemplateNameException, ParseException {
  3. // We can't store autoIncludes in LinkedHashSet-s because setAutoIncludes(List) allows duplicates,
  4. // unfortunately. Yet we have to prevent duplicates among Configuration levels, with the lowest levels having
  5. // priority. So we build some Set-s to do that, but we avoid the most common cases where they aren't needed.
  6. List<String> tAutoIncludes = t.getAutoIncludesWithoutFallback();
  7. List<String> envAutoIncludes = env.getAutoIncludesWithoutFallback();
  8. for (String templateName : getAutoIncludesWithoutFallback()) {
  9. if ((tAutoIncludes == null || !tAutoIncludes.contains(templateName))
  10. && (envAutoIncludes == null || !envAutoIncludes.contains(templateName))) {
  11. env.include(getTemplate(templateName, env.getLocale()));
  12. }
  13. }
  14. if (tAutoIncludes != null) {
  15. for (String templateName : tAutoIncludes) {
  16. if (envAutoIncludes == null || !envAutoIncludes.contains(templateName)) {
  17. env.include(getTemplate(templateName, env.getLocale()));
  18. }
  19. }
  20. }
  21. if (envAutoIncludes != null) {
  22. for (String templateName : envAutoIncludes) {
  23. env.include(getTemplate(templateName, env.getLocale()));
  24. }
  25. }
  26. }

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

  1. private void doAutoIncludes(Environment env, Template t) throws TemplateException, IOException,
  2. TemplateNotFoundException, MalformedTemplateNameException, ParseException {
  3. // We can't store autoIncludes in LinkedHashSet-s because setAutoIncludes(List) allows duplicates,
  4. // unfortunately. Yet we have to prevent duplicates among Configuration levels, with the lowest levels having
  5. // priority. So we build some Set-s to do that, but we avoid the most common cases where they aren't needed.
  6. List<String> tAutoIncludes = t.getAutoIncludesWithoutFallback();
  7. List<String> envAutoIncludes = env.getAutoIncludesWithoutFallback();
  8. for (String templateName : getAutoIncludesWithoutFallback()) {
  9. if ((tAutoIncludes == null || !tAutoIncludes.contains(templateName))
  10. && (envAutoIncludes == null || !envAutoIncludes.contains(templateName))) {
  11. env.include(getTemplate(templateName, env.getLocale()));
  12. }
  13. }
  14. if (tAutoIncludes != null) {
  15. for (String templateName : tAutoIncludes) {
  16. if (envAutoIncludes == null || !envAutoIncludes.contains(templateName)) {
  17. env.include(getTemplate(templateName, env.getLocale()));
  18. }
  19. }
  20. }
  21. if (envAutoIncludes != null) {
  22. for (String templateName : envAutoIncludes) {
  23. env.include(getTemplate(templateName, env.getLocale()));
  24. }
  25. }
  26. }

相关文章

Environment类方法