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

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

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

Configuration.createTemplateCache介绍

暂无

代码示例

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

this.incompatibleImprovements = incompatibleImprovements;
createTemplateCache();
loadBuiltInSharedVariables();

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

/**
 * Sets the {@link CacheStorage} used for caching {@link Template}-s. The
 * default is a {@link SoftCacheStorage}. If the total size of the {@link Template}
 * objects is significant but most templates are used rarely, using a
 * {@link MruCacheStorage} instead might be advisable. If you don't want caching at
 * all, use {@link freemarker.cache.NullCacheStorage} (you can't use <tt>null</tt>).
 */
public synchronized void setCacheStorage(CacheStorage storage) {
  createTemplateCache(cache.getTemplateLoader(), storage);
}

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

/**
 * Sets a template loader that is used to look up and load templates.
 * By providing your own template loader, you can customize the way
 * templates are loaded. Several convenience methods in this class already
 * allow you to install commonly used loaders:
 * {@link #setClassForTemplateLoading(Class, String)}, 
 * {@link #setDirectoryForTemplateLoading(File)}, and
 * {@link #setServletContextForTemplateLoading(Object, String)}. By default,
 * a multi-loader is used that first tries to load a template from the file
 * in the current directory, then from a resource on the classpath.
 */
public synchronized void setTemplateLoader(TemplateLoader loader) {
  createTemplateCache(loader, cache.getCacheStorage());
}

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

public Object clone() {
  try {
    Configuration copy = (Configuration)super.clone();
    copy.variables = new HashMap(variables);
    copy.encodingMap = new HashMap(encodingMap);
    copy.createTemplateCache(cache.getTemplateLoader(), cache.getCacheStorage());
    return copy;
  } catch (CloneNotSupportedException e) {
    throw new RuntimeException("Clone is not supported, but it should be: " + e.getMessage());
  }
}

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

this.incompatibleImprovements = incompatibleImprovements;
createTemplateCache();
loadBuiltInSharedVariables();

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

this.incompatibleImprovements = incompatibleImprovements;
createTemplateCache();
loadBuiltInSharedVariables();

相关文章

Configuration类方法