public class FreemarkerFileGenerator extends Object
| Modifier and Type | Field and Description |
|---|---|
protected freemarker.template.Configuration |
freemarker |
protected static org.slf4j.Logger |
log |
static Writer |
NullWriter |
static String |
UTF8 |
| Constructor and Description |
|---|
FreemarkerFileGenerator(File templateDir) |
| Modifier and Type | Method and Description |
|---|---|
List |
exeptFirst(Collection coll) |
List |
exeptLast(Collection coll) |
Object |
first(Collection coll) |
void |
generate() |
void |
generate(Writer out) |
String |
getBaseDir() |
String |
getCharset() |
File |
getDestFile() |
String |
getDestFileName() |
freemarker.template.Configuration |
getFreemarker() |
Map |
getRoot() |
String |
getTemplateName() |
Object |
last(Collection coll) |
void |
outputToFile(String newDestFile)
Utility method for templates that need to change the
output file during template processing!
|
void |
outputToNull()
Utility method for template to write template output to 'nothing'.
|
void |
outputToWriter(Writer outWriter)
Utility method for template to write to the given writer
|
void |
putModel(String name,
Object obj) |
void |
setBaseDir(String baseDir) |
void |
setCharset(String charset) |
void |
setDestFileName(String target) |
void |
setTemplateName(String templateName) |
protected static final org.slf4j.Logger log
protected freemarker.template.Configuration freemarker
public static final String UTF8
public static final Writer NullWriter
public FreemarkerFileGenerator(File templateDir) throws IOException
IOExceptionpublic void setTemplateName(String templateName)
public void setCharset(String charset)
public void setDestFileName(String target)
public Map getRoot()
public String getTemplateName()
public String getCharset()
public String getDestFileName()
public String getBaseDir()
public void setBaseDir(String baseDir)
public void generate()
throws IOException,
freemarker.template.TemplateException
IOExceptionfreemarker.template.TemplateExceptionpublic void generate(Writer out) throws IOException
IOExceptionpublic File getDestFile()
public void outputToFile(String newDestFile) throws IOException
IOExceptionoutputToNull()public void outputToNull()
throws IOException
IOExceptionoutputToFile(String)public void outputToWriter(Writer outWriter) throws IOException
outWriter - IOExceptionpublic freemarker.template.Configuration getFreemarker()
public List exeptLast(Collection coll)
public Object last(Collection coll)
public List exeptFirst(Collection coll)
public Object first(Collection coll)
Copyright © 2008-2016. All Rights Reserved.