Package freemarker.cache

Examples of freemarker.cache.TemplateLoader


                templateMap.put(template.getTemplateName(), template);
                templateCache.put(template.getTemplateName(), template.getBodyTemplate());
                templateCache.put(template.getTemplateName() + DEFAULT_SUBJECT_SUFFIX, template.getSubjectTemplate());
            }
            freemarkerConfiguration = new Configuration();
            freemarkerConfiguration.setTemplateLoader(new TemplateLoader() {
                @Override
                public Object findTemplateSource(String name) throws IOException {
                    return templateCache.containsKey(name) ? templateCache.get(name) : null;
                }
View Full Code Here


    this.token = participantToken;
    initTemplating();
  }

  private void initTemplating() {
    TemplateLoader loader = new ClassTemplateLoader(this.getClass(), "/");
    cfg = new Configuration();
    cfg.setTemplateLoader(loader);
    cfg.setObjectWrapper(new DefaultObjectWrapper());
  }
View Full Code Here

  public FreemarkerPlugin(TemplatesConfiguration configs){
   
    this.configs = configs;
    this.cfg = new Configuration();
   
    TemplateLoader loader;
   
    try {
      loader = new FileTemplateLoader(new File(configs.getTemplatesPath()));
      cfg.setTemplateLoader(loader);
      if(configs.allowCaching())
View Full Code Here

TOP

Related Classes of freemarker.cache.TemplateLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.