public class TemplateConfiguration
extends java.lang.Object
markup template engine
.Constructor and Description |
---|
TemplateConfiguration() |
TemplateConfiguration(TemplateConfiguration that) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAutoIndentString() |
java.lang.Class<? extends BaseTemplate> |
getBaseTemplateClass() |
java.lang.String |
getDeclarationEncoding() |
java.util.Locale |
getLocale() |
java.lang.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(java.lang.String autoIndentString) |
void |
setAutoNewLine(boolean autoNewLine) |
void |
setBaseTemplateClass(java.lang.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(java.lang.String declarationEncoding)
Set the encoding used to write the declaration header.
|
void |
setExpandEmptyElements(boolean expandEmptyElements) |
void |
setLocale(java.util.Locale locale) |
void |
setNewLineString(java.lang.String newLineString) |
void |
setUseDoubleQuotes(boolean useDoubleQuotes) |
public TemplateConfiguration()
public TemplateConfiguration(TemplateConfiguration that)
public java.lang.String getDeclarationEncoding()
public void setDeclarationEncoding(java.lang.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 java.lang.String getNewLineString()
public void setNewLineString(java.lang.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 java.lang.String getAutoIndentString()
public void setAutoIndentString(java.lang.String autoIndentString)
public boolean isAutoNewLine()
public void setAutoNewLine(boolean autoNewLine)
public java.lang.Class<? extends BaseTemplate> getBaseTemplateClass()
public void setBaseTemplateClass(java.lang.Class<? extends BaseTemplate> baseTemplateClass)
baseTemplateClass
- a class extending BaseTemplate
public java.util.Locale getLocale()
public void setLocale(java.util.Locale locale)
public boolean isCacheTemplates()
public void setCacheTemplates(boolean cacheTemplates)
cacheTemplates
- should templates be cached