public class TemplateConfiguration extends Object
Configuration options for the markup template engine.
Constructor and description |
---|
TemplateConfiguration
() |
TemplateConfiguration
(TemplateConfiguration that) |
Type Params | Return Type | Name and description |
---|---|---|
|
public String |
getAutoIndentString() |
|
public Class<? extends BaseTemplate> |
getBaseTemplateClass() |
|
public String |
getDeclarationEncoding()
|
|
public Locale |
getLocale() |
|
public String |
getNewLineString() |
|
public boolean |
isAutoEscape()
|
|
public boolean |
isAutoIndent()
|
|
public boolean |
isAutoNewLine() |
|
public boolean |
isCacheTemplates() |
|
public boolean |
isExpandEmptyElements()
|
|
public boolean |
isUseDoubleQuotes()
|
|
public 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. |
|
public void |
setAutoIndent(boolean autoIndent) Set this to true if you want the template engine to render indents automatically. |
|
public void |
setAutoIndentString(String autoIndentString) |
|
public void |
setAutoNewLine(boolean autoNewLine) |
|
public void |
setBaseTemplateClass(Class<? extends BaseTemplate> baseTemplateClass) Set the template base class. |
|
public void |
setCacheTemplates(boolean cacheTemplates) If cache is enabled, then templates are compiled once for each source (URL or File). |
|
public void |
setDeclarationEncoding(String declarationEncoding) Set the encoding used to write the declaration header. |
|
public void |
setExpandEmptyElements(boolean expandEmptyElements) |
|
public void |
setLocale(Locale locale) |
|
public void |
setNewLineString(String newLineString) |
|
public void |
setUseDoubleQuotes(boolean useDoubleQuotes) |
Set to true if you want variables in the model which are assignable to 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 $variable
autoEscape
- value if the autoEscape flagSet this to true if you want the template engine to render indents automatically. In that case, the supplied writer is wrapped into a DelegatingIndentWriter and indents are inserted after each call to newLine.
autoIndent
- the auto-indent flagSet the template base class. You can use a distinct template class to provide more statically available data to your templates.
baseTemplateClass
- a class extending BaseTemplateIf cache is enabled, then templates are compiled once for each source (URL or File). It is recommended to keep this flag to true unless you are in development mode and want automatic reloading of templates.
cacheTemplates
- should templates be cachedSet the encoding used to write the declaration header. Note that it is the responsibility of the user to ensure that it matches the writer encoding.
declarationEncoding
- encoding to be used in the declaration stringCopyright © 2003-2020 The Apache Software Foundation. All rights reserved.