Package freemarker.core
Class TemplateCore
- java.lang.Object
-
- freemarker.core.Configurable
-
- freemarker.core.TemplateCore
-
- Direct Known Subclasses:
Template
public abstract class TemplateCore extends Configurable
Abstract base class forTemplate. Used to provide package-level access to secured internals used byEnvironment.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class freemarker.core.Configurable
Configurable.UnknownSettingException
-
-
Field Summary
-
Fields inherited from class freemarker.core.Configurable
ARITHMETIC_ENGINE_KEY, BOOLEAN_FORMAT_KEY, DATE_FORMAT_KEY, DATETIME_FORMAT_KEY, LOCALE_KEY, NUMBER_FORMAT_KEY, OBJECT_WRAPPER_KEY, OUTPUT_ENCODING_KEY, STRICT_BEAN_MODELS, TEMPLATE_EXCEPTION_HANDLER_KEY, TIME_FORMAT_KEY, TIME_ZONE_KEY, URL_ESCAPING_CHARSET_KEY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTemplateCore(Configuration config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMacro(freemarker.core.ast.Macro macro)Called by code internally to maintain a table of macrosprotected static voidcheckModifyTemplate()voiddump(PrintStream ps)Dump the raw template in canonical form.voiddump(Writer out)Dump the raw template in canonical form.Map<String,freemarker.core.ast.Macro>getMacros()protected freemarker.core.ast.TemplateElementgetRootElement()protected voidsetRootElement(freemarker.core.ast.TemplateElement rootElement)-
Methods inherited from class freemarker.core.Configurable
clone, doAutoImportsAndIncludes, getArithmeticEngine, getBooleanFormat, getBooleanFormat, getCustomAttribute, getCustomAttributeNames, getDateFormat, getDateTimeFormat, getEnvironment, getLocale, getNumberFormat, getObjectWrapper, getOutputEncoding, getParent, getSetting, getSettings, getTemplateExceptionHandler, getTimeFormat, getTimeZone, getURLEscapingCharset, invalidSettingValueException, removeCustomAttribute, setArithmeticEngine, setBooleanFormat, setCustomAttribute, setDateFormat, setDateTimeFormat, setLocale, setNumberFormat, setNumbersForComputers, setObjectWrapper, setOutputEncoding, setParent, setSetting, setSettings, setSettings, setStrictBeanModels, setTemplateExceptionHandler, setTimeFormat, setTimeZone, setURLEscapingCharset, unknownSettingException
-
-
-
-
Constructor Detail
-
TemplateCore
protected TemplateCore(Configuration config)
-
-
Method Detail
-
addMacro
public void addMacro(freemarker.core.ast.Macro macro)
Called by code internally to maintain a table of macros- Throws:
SecurityException- if the macro with this name already exists, getConfiguration().isSecure() returns true, there is a security manager in the JVM, and the caller of this method does not posess the "modifyTemplate" FreeMarker permission.
-
checkModifyTemplate
protected static void checkModifyTemplate()
-
getMacros
public Map<String,freemarker.core.ast.Macro> getMacros()
- Throws:
SecurityException- if the getConfiguration().isSecure() returns true, there is a security manager in the JVM, and the caller of this method does not posess the "modifyTemplate" FreeMarker permission (since both the retrieved map and the macros in it are mutable).
-
dump
public void dump(PrintStream ps)
Dump the raw template in canonical form.
-
dump
public void dump(Writer out) throws IOException
Dump the raw template in canonical form.- Throws:
IOException
-
getRootElement
protected freemarker.core.ast.TemplateElement getRootElement()
-
setRootElement
protected void setRootElement(freemarker.core.ast.TemplateElement rootElement)
-
-