Package groovy.text.markup
Class TemplateConfiguration
- java.lang.Object
- 
- groovy.text.markup.TemplateConfiguration
 
- 
 public class TemplateConfiguration extends java.lang.ObjectConfiguration options for themarkup template engine.
- 
- 
Constructor SummaryConstructors Constructor Description TemplateConfiguration()TemplateConfiguration(TemplateConfiguration that)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAutoIndentString()java.lang.Class<? extends BaseTemplate>getBaseTemplateClass()java.lang.StringgetDeclarationEncoding()java.util.LocalegetLocale()java.lang.StringgetNewLineString()booleanisAutoEscape()booleanisAutoIndent()booleanisAutoNewLine()booleanisCacheTemplates()booleanisExpandEmptyElements()booleanisUseDoubleQuotes()voidsetAutoEscape(boolean autoEscape)Set to true if you want variables in the model which are assignable toCharSequenceto be escaped automatically in templates.voidsetAutoIndent(boolean autoIndent)Set this to true if you want the template engine to render indents automatically.voidsetAutoIndentString(java.lang.String autoIndentString)voidsetAutoNewLine(boolean autoNewLine)voidsetBaseTemplateClass(java.lang.Class<? extends BaseTemplate> baseTemplateClass)Set the template base class.voidsetCacheTemplates(boolean cacheTemplates)If cache is enabled, then templates are compiled once for each source (URL or File).voidsetDeclarationEncoding(java.lang.String declarationEncoding)Set the encoding used to write the declaration header.voidsetExpandEmptyElements(boolean expandEmptyElements)voidsetLocale(java.util.Locale locale)voidsetNewLineString(java.lang.String newLineString)voidsetUseDoubleQuotes(boolean useDoubleQuotes)
 
- 
- 
- 
Constructor Detail- 
TemplateConfigurationpublic TemplateConfiguration() 
 - 
TemplateConfigurationpublic TemplateConfiguration(TemplateConfiguration that) 
 
- 
 - 
Method Detail- 
getDeclarationEncodingpublic java.lang.String getDeclarationEncoding() - Returns:
- the encoding used in the declaration header
 
 - 
setDeclarationEncodingpublic void setDeclarationEncoding(java.lang.String declarationEncoding) Set 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.- Parameters:
- declarationEncoding- encoding to be used in the declaration string
 
 - 
isExpandEmptyElementspublic boolean isExpandEmptyElements() - Returns:
- whether elements without body should be written in the short form (ex: <br/>) or in an expanded form (ex: <br></br>)
 
 - 
setExpandEmptyElementspublic void setExpandEmptyElements(boolean expandEmptyElements) 
 - 
isUseDoubleQuotespublic boolean isUseDoubleQuotes() - Returns:
- true if attributes should use double quotes instead of single quotes
 
 - 
setUseDoubleQuotespublic void setUseDoubleQuotes(boolean useDoubleQuotes) 
 - 
getNewLineStringpublic java.lang.String getNewLineString() 
 - 
setNewLineStringpublic void setNewLineString(java.lang.String newLineString) 
 - 
isAutoEscapepublic boolean isAutoEscape() - Returns:
- true if variables in the model which are assignable to CharSequenceshould be automatically escaped.
 
 - 
setAutoEscapepublic void setAutoEscape(boolean autoEscape) Set to true if you want variables in the model which are assignable toCharSequenceto 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- Parameters:
- autoEscape- value if the autoEscape flag
 
 - 
isAutoIndentpublic boolean isAutoIndent() - Returns:
- true if the template engine should handle indents automatically
 
 - 
setAutoIndentpublic void setAutoIndent(boolean autoIndent) Set this to true if you want the template engine to render indents automatically. In that case, the supplied writer is wrapped into aDelegatingIndentWriterand indents are inserted after each call to newLine.- Parameters:
- autoIndent- the auto-indent flag
 
 - 
getAutoIndentStringpublic java.lang.String getAutoIndentString() 
 - 
setAutoIndentStringpublic void setAutoIndentString(java.lang.String autoIndentString) 
 - 
isAutoNewLinepublic boolean isAutoNewLine() 
 - 
setAutoNewLinepublic void setAutoNewLine(boolean autoNewLine) 
 - 
getBaseTemplateClasspublic java.lang.Class<? extends BaseTemplate> getBaseTemplateClass() 
 - 
setBaseTemplateClasspublic void setBaseTemplateClass(java.lang.Class<? extends BaseTemplate> baseTemplateClass) Set the template base class. You can use a distinct template class to provide more statically available data to your templates.- Parameters:
- baseTemplateClass- a class extending- BaseTemplate
 
 - 
getLocalepublic java.util.Locale getLocale() 
 - 
setLocalepublic void setLocale(java.util.Locale locale) 
 - 
isCacheTemplatespublic boolean isCacheTemplates() 
 - 
setCacheTemplatespublic void setCacheTemplates(boolean cacheTemplates) If 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.- Parameters:
- cacheTemplates- should templates be cached
 
 
- 
 
-