Package | Description |
---|---|
freemarker.cache |
Template loading and caching.
|
freemarker.core |
The seldom used or advanced parts of the fundamental FreeMarker API, compared to
freemarker.template . |
freemarker.ext.servlet |
Servlet for legacy "Model 2" frameworks that allows using FreeMarker
templates instead of JSP as the MVC View
(see in the Manual).
|
freemarker.template |
The fundamental, most commonly used API-s of FreeMarker;
start with
Configuration (also see
Getting Stared in the Manual.) |
Modifier and Type | Method and Description |
---|---|
Template |
TemplateCache.getTemplate(java.lang.String name,
java.util.Locale locale,
java.lang.String encoding,
boolean parseAsFTL)
Retrieves the template with the given name (and according the specified further parameters) from the
template cache, loading it into the cache first if it's missing/staled.
|
Modifier and Type | Method and Description |
---|---|
Template |
Environment.getTemplate()
Retrieves the currently processed template.
|
Template |
Environment.Namespace.getTemplate() |
Template |
Environment.getTemplateForImporting(java.lang.String name)
Gets a template for importing; used with
Environment.importLib(Template importedTemplate, String namespace) . |
Template |
Environment.getTemplateForInclusion(java.lang.String name,
java.lang.String encoding,
boolean parse)
Gets a template for inclusion; used with
Environment.include(Template includedTemplate) . |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
CustomAttribute.get(Template t) |
Environment.Namespace |
Environment.importLib(Template loadedTemplate,
java.lang.String namespace)
Emulates
import directive. |
void |
Environment.include(Template includedTemplate)
Processes a Template in the context of this
Environment , including its
output in the Environment 's Writer. |
java.lang.Class |
TemplateClassResolver.resolve(java.lang.String className,
Environment env,
Template template)
Gets a
Class based on the class name. |
java.lang.Class |
OptInTemplateClassResolver.resolve(java.lang.String className,
Environment env,
Template template) |
protected java.lang.String |
OptInTemplateClassResolver.safeGetTemplateName(Template template)
Extract the template name from the template object which will be matched
against the trusted template names and pattern.
|
void |
CustomAttribute.set(java.lang.Object value,
Template t)
Sets the value of a template-scope attribute in the context of the given
template.
|
void |
FreeMarkerTree.setTemplate(Template template) |
Constructor and Description |
---|
Environment(Template template,
TemplateHashModel rootDataModel,
java.io.Writer out) |
FreeMarkerTree(Template template) |
ParseException(java.lang.String description,
Template template,
int lineNumber,
int columnNumber) |
ParseException(java.lang.String description,
Template template,
int lineNumber,
int columnNumber,
java.lang.Throwable cause) |
ParseException(java.lang.String description,
Template template,
freemarker.core.Token tk) |
ParseException(java.lang.String description,
Template template,
freemarker.core.Token tk,
java.lang.Throwable cause) |
Modifier and Type | Method and Description |
---|---|
protected void |
FreemarkerServlet.postTemplateProcess(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Template template,
TemplateModel data)
Called after the execution returns from template.process().
|
protected boolean |
FreemarkerServlet.preTemplateProcess(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Template template,
TemplateModel data)
Called before the execution is passed to template.process().
|
Modifier and Type | Method and Description |
---|---|
static Template |
Template.getPlainTextTemplate(java.lang.String name,
java.lang.String content,
Configuration config)
Returns a trivial template, one that is just a single block of
plain text, no dynamic content.
|
Template |
Configuration.getTemplate(java.lang.String name)
Retrieves the template with the given name from the template cache, loading it into the cache first if it's
missing/staled.
|
Template |
Configuration.getTemplate(java.lang.String name,
java.util.Locale locale)
Shorthand for
getTemplate(name, locale, getEncoding(locale), true) . |
Template |
Configuration.getTemplate(java.lang.String name,
java.util.Locale locale,
java.lang.String encoding)
Shorthand for
getTemplate(name, locale, encoding, true) . |
Template |
Configuration.getTemplate(java.lang.String name,
java.util.Locale locale,
java.lang.String encoding,
boolean parseAsFTL)
Retrieves the template with the given name (and according the specified further parameters) from the template
cache, loading it into the cache first if it's missing/staled.
|
Template |
Configuration.getTemplate(java.lang.String name,
java.lang.String encoding)
Shorthand for
getTemplate(name, getLocale(), encoding, true) . |