public class TemplateConfiguration extends Object
markup template engine
.Constructor and Description |
---|
TemplateConfiguration() |
TemplateConfiguration(TemplateConfiguration that) |
Modifier and Type | Method and Description |
---|---|
String |
getAutoIndentString() |
Class<? extends BaseTemplate> |
getBaseTemplateClass() |
String |
getDeclarationEncoding() |
Locale |
getLocale() |
String |
getNewLineString() |
boolean |
isAutoEscape() |
boolean |
isAutoIndent() |
boolean |
isAutoNewLine() |
boolean |
isCacheTemplates() |
boolean |
isExpandEmptyElements() |
boolean |
isUseDoubleQuotes() |
void |
setAutoEscape(boolean autoEscape)
Set to true if you want variables in the model which are assignable to
CharSequence to
be escaped automatically in templates. |
void |
setAutoIndent(boolean autoIndent)
Set this to true if you want the template engine to render indents automatically.
|
void |
setAutoIndentString(String autoIndentString) |
void |
setAutoNewLine(boolean autoNewLine) |
void |
setBaseTemplateClass(Class<? extends BaseTemplate> baseTemplateClass)
Set the template base class.
|
void |
setCacheTemplates(boolean cacheTemplates)
If cache is enabled, then templates are compiled once for each source (URL or File).
|
void |
setDeclarationEncoding(String declarationEncoding)
Set the encoding used to write the declaration header.
|
void |
setExpandEmptyElements(boolean expandEmptyElements) |
void |
setLocale(Locale locale) |
void |
setNewLineString(String newLineString) |
void |
setUseDoubleQuotes(boolean useDoubleQuotes) |
public TemplateConfiguration()
public TemplateConfiguration(TemplateConfiguration that)
public String getDeclarationEncoding()
public void setDeclarationEncoding(String declarationEncoding)
declarationEncoding
- encoding to be used in the declaration stringpublic boolean isExpandEmptyElements()
public void setExpandEmptyElements(boolean expandEmptyElements)
public boolean isUseDoubleQuotes()
public void setUseDoubleQuotes(boolean useDoubleQuotes)
public String getNewLineString()
public void setNewLineString(String newLineString)
public boolean isAutoEscape()
CharSequence
should be
automatically escaped.public void setAutoEscape(boolean autoEscape)
CharSequence
to
be escaped automatically in templates. If this flag is set to true and that you want a value not to be
automatically escaped, then you need to use ${unescaped.variable} instead of $variableautoEscape
- value if the autoEscape flagpublic boolean isAutoIndent()
public void setAutoIndent(boolean autoIndent)
DelegatingIndentWriter
and indents
are inserted after each call to newLine.autoIndent
- the auto-indent flagpublic String getAutoIndentString()
public void setAutoIndentString(String autoIndentString)
public boolean isAutoNewLine()
public void setAutoNewLine(boolean autoNewLine)
public Class<? extends BaseTemplate> getBaseTemplateClass()
public void setBaseTemplateClass(Class<? extends BaseTemplate> baseTemplateClass)
baseTemplateClass
- a class extending BaseTemplate
public Locale getLocale()
public void setLocale(Locale locale)
public boolean isCacheTemplates()
public void setCacheTemplates(boolean cacheTemplates)
cacheTemplates
- should templates be cached