Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Constructor and description |
---|
TemplateConfiguration
() |
TemplateConfiguration
(TemplateConfiguration that) |
Type | Name and description |
---|---|
String |
getAutoIndentString() |
Class<? extends BaseTemplate> |
getBaseTemplateClass() |
String |
getDeclarationEncoding() @return the encoding used in the declaration header |
Locale |
getLocale() |
String |
getNewLineString() |
boolean |
isAutoEscape() @return true if variables in the model which are assignable to CharSequence should be automatically escaped. |
boolean |
isAutoIndent() @return true if the template engine should handle indents automatically |
boolean |
isAutoNewLine() |
boolean |
isCacheTemplates() |
boolean |
isExpandEmptyElements() @return whether elements without body should be written in the short form (ex: <br/>) or in an expanded form (ex: <br></br>) |
boolean |
isUseDoubleQuotes() @return true if attributes should use double quotes instead of single quotes |
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) |
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 distrinct 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 responsability of the user to ensure that it matches the writer encoding.
declarationEncoding
- encoding to be used in the declaration stringCopyright © 2003-2015 The Apache Software Foundation. All rights reserved.