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 (see also the
Getting Started in the Manual.) |
Modifier and Type | Method and Description |
---|---|
Template |
TemplateCache.MaybeMissingTemplate.getTemplate()
The
Template if it wasn't missing, otherwise null . |
Template |
TemplateCache.getTemplate(java.lang.String name,
java.util.Locale locale,
java.lang.String encoding,
boolean parseAsFTL)
Deprecated.
Use
TemplateCache.getTemplate(String, Locale, Object, String, boolean) , which can return more detailed
result when the template is missing. |
Modifier and Type | Method and Description |
---|---|
Template |
Environment.getCurrentTemplate()
Returns the
Template that we are "lexically" inside at the moment. |
Template |
Environment.getMainTemplate()
Returns the topmost
Template , with other words, the one for which this Environment was created. |
Template |
Environment.getTemplate()
Deprecated.
Use
Environment.getMainTemplate() instead (or Environment.getCurrentNamespace() and then
Environment.Namespace.getTemplate() ); the value returned by this method is often not what you expect when
it comes to macro/function invocations. |
Template |
Environment.Namespace.getTemplate() |
Template |
DirectiveCallPlace.getTemplate()
The template that contains this call;
null if the call is not from a template (but directly from
user Java code, for example). |
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)
Same as
Environment.getTemplateForInclusion(String, String, boolean, boolean) with false
ignoreMissing argument. |
Template |
Environment.getTemplateForInclusion(java.lang.String name,
java.lang.String encoding,
boolean parseAsFTL,
boolean ignoreMissing)
Gets a template for inclusion; used for implementing
Environment.include(Template includedTemplate) . |
Modifier and Type | Method and Description |
---|---|
void |
TemplateConfiguration.apply(Template template)
Sets those settings of the
Template which aren't yet set in the Template and are set in this
TemplateConfiguration , leaves the other settings as is. |
java.lang.Object |
CustomAttribute.get(Template template)
|
Environment.Namespace |
Environment.importLib(Template loadedTemplate,
java.lang.String targetNsVarName)
Does what the
#import directive does, but with an already loaded template. |
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 template)
|
void |
FreeMarkerTree.setTemplate(Template template)
Deprecated.
|
Constructor and Description |
---|
Environment(Template template,
TemplateHashModel rootDataModel,
java.io.Writer out) |
FreeMarkerTree(Template template)
Deprecated.
|
ParseException(java.lang.String description,
Template template,
int lineNumber,
int columnNumber)
Deprecated.
Use
ParseException.ParseException(String, Template, int, int, int, int) instead, as IDE-s need the end
position of the error too. |
ParseException(java.lang.String description,
Template template,
int lineNumber,
int columnNumber,
int endLineNumber,
int endColumnNumber) |
ParseException(java.lang.String description,
Template template,
int lineNumber,
int columnNumber,
int endLineNumber,
int endColumnNumber,
java.lang.Throwable cause) |
ParseException(java.lang.String description,
Template template,
int lineNumber,
int columnNumber,
java.lang.Throwable cause)
Deprecated.
Use
ParseException.ParseException(String, Template, int, int, int, int, Throwable) instead, as IDE-s need
the end position of the error too. |
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
process(Object, java.io.Writer) . |
protected boolean |
FreemarkerServlet.preTemplateProcess(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Template template,
TemplateModel model)
Called before the execution is passed to
process(Object, java.io.Writer) . |
Modifier and Type | Method and Description |
---|---|
static Template |
Template.getPlainTextTemplate(java.lang.String name,
java.lang.String content,
Configuration config)
|
static Template |
Template.getPlainTextTemplate(java.lang.String name,
java.lang.String sourceName,
java.lang.String content,
Configuration config)
Creates (not "get"-s) a
Template that only contains a single block of static 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, null, null, true, false) . |
Template |
Configuration.getTemplate(java.lang.String name,
java.util.Locale locale,
java.lang.Object customLookupCondition,
java.lang.String encoding,
boolean parseAsFTL,
boolean ignoreMissing)
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.util.Locale locale,
java.lang.String encoding)
Shorthand for
getTemplate(name, locale, null, encoding, true, false) . |
Template |
Configuration.getTemplate(java.lang.String name,
java.util.Locale locale,
java.lang.String encoding,
boolean parseAsFTL)
Shorthand for
getTemplate(name, locale, null, encoding, parseAsFTL, false) . |
Template |
Configuration.getTemplate(java.lang.String name,
java.util.Locale locale,
java.lang.String encoding,
boolean parseAsFTL,
boolean ignoreMissing)
|
Template |
Configuration.getTemplate(java.lang.String name,
java.lang.String encoding)
Shorthand for
getTemplate(name, null, null, encoding, true, false) . |