Package br.com.caelum.tubaina.parser.html

Source Code of br.com.caelum.tubaina.parser.html.IndexToString

package br.com.caelum.tubaina.parser.html;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import br.com.caelum.tubaina.template.FreemarkerProcessor;
import br.com.caelum.tubaina.util.HtmlSanitizer;
import freemarker.template.Configuration;

public class IndexToString {

  private final List<String> dirTree;

  private final Configuration cfg;

  public IndexToString(final List<String> dirTree, final Configuration cfg) {
    this.dirTree = dirTree;
    this.cfg = cfg;
  }

  public StringBuffer createIndex(final Map<String, Integer> indexes) {
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("dirTree", dirTree);
    map.put("indexes", indexes);
    map.put("sanitizer", new HtmlSanitizer());
    return new FreemarkerProcessor(cfg).process(map, "html/index.ftl");
  }

}
TOP

Related Classes of br.com.caelum.tubaina.parser.html.IndexToString

TOP
Copyright © 2018 www.massapi.com. 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.