Package | Description |
---|---|
freemarker.core |
The seldom used or advanced parts of the fundamental FreeMarker API, compared to
freemarker.template . |
freemarker.ext.beans |
The default object wrapper of FreeMarker uses
this to expose Java Beans and POJO-s to templates.
|
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 | Class and Description |
---|---|
class |
freemarker.core._MiscTemplateException |
static class |
Configurable.SettingValueAssignmentException
The setting name was recognized, but its value couldn't be parsed or the setting couldn't be set for some
other reason.
|
static class |
Configurable.UnknownSettingException
The setting name was not recognized.
|
class |
InvalidReferenceException
A subclass of
TemplateException that says that an FTL expression has evaluated to null or it refers
to something that doesn't exist. |
class |
NonBooleanException
Indicates that a
TemplateBooleanModel value was expected, but the value had a different type. |
class |
NonDateException
Indicates that a
TemplateDateModel value was expected, but the value had a different type. |
class |
NonExtendedHashException
Indicates that a
TemplateHashModelEx value was expected, but the value had a different type. |
class |
NonExtendedNodeException
Indicates that a
TemplateNodeModelEx value was expected, but the value had a different type. |
class |
NonHashException
Indicates that a
TemplateHashModel value was expected, but the value had a different type. |
class |
NonMarkupOutputException
Indicates that a
TemplateMarkupOutputModel value was expected, but the value had a different type. |
class |
NonMethodException
Indicates that a
TemplateMethodModel value was expected, but the value had a different type. |
class |
NonNodeException
Indicates that a
TemplateNodeModel value was expected, but the value had a different type. |
class |
NonNumericalException
Indicates that a
TemplateNumberModel value was expected, but the value had a different type. |
class |
NonSequenceException
Indicates that a
TemplateSequenceModel value was expected, but the value had a different type. |
class |
NonSequenceOrCollectionException
Indicates that a
TemplateSequenceModel or TemplateCollectionModel value was expected, but the value
had a different type. |
class |
NonStringException
Indicates that a
TemplateScalarModel value was expected (or maybe something that can be automatically coerced
to that), but the value had a different type. |
class |
NonStringOrTemplateOutputException
Indicates that a
TemplateScalarModel (or maybe something that can be automatically coerced
to that) or TemplateMarkupOutputModel value was expected, but the value had a different type. |
class |
StopException
This exception is thrown when a #stop directive is encountered.
|
class |
UnexpectedTypeException
The type of a value differs from what was expected.
|
Modifier and Type | Method and Description |
---|---|
protected TemplateException |
Configurable.invalidSettingValueException(java.lang.String name,
java.lang.String value) |
protected TemplateException |
Configurable.settingValueAssignmentException(java.lang.String name,
java.lang.String value,
java.lang.Throwable cause) |
protected TemplateException |
Configurable.unknownSettingException(java.lang.String name)
Creates the exception that should be thrown when a setting name isn't recognized.
|
Modifier and Type | Method and Description |
---|---|
void |
Environment.__setitem__(java.lang.String key,
java.lang.Object o)
A hook that Jython uses.
|
abstract java.lang.Number |
ArithmeticEngine.add(java.lang.Number first,
java.lang.Number second) |
java.lang.Number |
ArithmeticEngine.ConservativeEngine.add(java.lang.Number first,
java.lang.Number second) |
boolean |
Environment.applyEqualsOperator(TemplateModel leftValue,
TemplateModel rightValue)
Compares two
TemplateModel -s according the rules of the FTL "==" operator. |
boolean |
Environment.applyEqualsOperatorLenient(TemplateModel leftValue,
TemplateModel rightValue)
Compares two
TemplateModel -s according the rules of the FTL "==" operator, except that if the two types
are incompatible, they are treated as non-equal instead of throwing an exception. |
boolean |
Environment.applyGreaterThanOperator(TemplateModel leftValue,
TemplateModel rightValue)
Compares two
TemplateModel -s according the rules of the FTL ">" operator. |
boolean |
Environment.applyLessThanOperator(TemplateModel leftValue,
TemplateModel rightValue)
Compares two
TemplateModel -s according the rules of the FTL "<" operator. |
boolean |
Environment.applyLessThanOrEqualsOperator(TemplateModel leftValue,
TemplateModel rightValue)
Compares two
TemplateModel -s according the rules of the FTL "<" operator. |
boolean |
Environment.applyWithGreaterThanOrEqualsOperator(TemplateModel leftValue,
TemplateModel rightValue)
Compares two
TemplateModel -s according the rules of the FTL ">=" operator. |
abstract int |
ArithmeticEngine.compareNumbers(java.lang.Number first,
java.lang.Number second) |
int |
ArithmeticEngine.ConservativeEngine.compareNumbers(java.lang.Number first,
java.lang.Number second) |
abstract java.lang.Number |
ArithmeticEngine.divide(java.lang.Number first,
java.lang.Number second) |
java.lang.Number |
ArithmeticEngine.ConservativeEngine.divide(java.lang.Number first,
java.lang.Number second) |
protected void |
Configurable.doAutoImportsAndIncludes(Environment env)
Executes the auto-imports and auto-includes for the main template of this environment.
|
Environment.Namespace |
Environment.importLib(java.lang.String templateName,
java.lang.String targetNsVarName)
Emulates
import directive, except that templateName must be template root relative. |
Environment.Namespace |
Environment.importLib(java.lang.String templateName,
java.lang.String targetNsVarName,
boolean lazy)
Like
Environment.importLib(String, String) , but you can specify if you want a
lazy import or not. |
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(java.lang.String name,
java.lang.String encoding,
boolean parse)
Emulates
include directive, except that name must be template root relative. |
void |
Environment.include(Template includedTemplate)
Processes a Template in the context of this
Environment , including its output in the
Environment 's Writer. |
abstract java.lang.Number |
ArithmeticEngine.modulus(java.lang.Number first,
java.lang.Number second) |
java.lang.Number |
ArithmeticEngine.ConservativeEngine.modulus(java.lang.Number first,
java.lang.Number second) |
abstract java.lang.Number |
ArithmeticEngine.multiply(java.lang.Number first,
java.lang.Number second) |
java.lang.Number |
ArithmeticEngine.ConservativeEngine.multiply(java.lang.Number first,
java.lang.Number second) |
void |
Environment.process()
Processes the template to which this environment belongs to.
|
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) |
void |
Configurable.setSetting(java.lang.String name,
java.lang.String value)
Sets a FreeMarker setting by a name and string value.
|
void |
Configurable.setSettings(java.io.InputStream propsIn)
Reads a setting list (key and element pairs) from the input stream.
|
void |
Configurable.setSettings(java.util.Properties props)
Set the settings stored in a
Properties object. |
abstract java.lang.Number |
ArithmeticEngine.subtract(java.lang.Number first,
java.lang.Number second) |
java.lang.Number |
ArithmeticEngine.ConservativeEngine.subtract(java.lang.Number first,
java.lang.Number second) |
abstract TemplateScalarModel |
TruncateBuiltinAlgorithm.truncate(java.lang.String s,
int maxLength,
TemplateScalarModel terminator,
java.lang.Integer terminatorLength,
Environment env)
Corresponds to
?truncate(...) in templates. |
TemplateScalarModel |
DefaultTruncateBuiltinAlgorithm.truncate(java.lang.String s,
int maxLength,
TemplateScalarModel terminator,
java.lang.Integer terminatorLength,
Environment env) |
abstract TemplateScalarModel |
TruncateBuiltinAlgorithm.truncateC(java.lang.String s,
int maxLength,
TemplateScalarModel terminator,
java.lang.Integer terminatorLength,
Environment env)
Corresponds to
?truncate_c_m(...) in templates. |
TemplateScalarModel |
DefaultTruncateBuiltinAlgorithm.truncateC(java.lang.String s,
int maxLength,
TemplateScalarModel terminator,
java.lang.Integer terminatorLength,
Environment env) |
abstract TemplateModel |
TruncateBuiltinAlgorithm.truncateCM(java.lang.String s,
int maxLength,
TemplateModel terminator,
java.lang.Integer terminatorLength,
Environment env)
Corresponds to
?truncate_c_m(...) in templates. |
TemplateModel |
DefaultTruncateBuiltinAlgorithm.truncateCM(java.lang.String s,
int maxLength,
TemplateModel terminator,
java.lang.Integer terminatorLength,
Environment env) |
abstract TemplateModel |
TruncateBuiltinAlgorithm.truncateM(java.lang.String s,
int maxLength,
TemplateModel terminator,
java.lang.Integer terminatorLength,
Environment env)
Corresponds to
?truncate_m(...) in templates. |
TemplateModel |
DefaultTruncateBuiltinAlgorithm.truncateM(java.lang.String s,
int maxLength,
TemplateModel terminator,
java.lang.Integer terminatorLength,
Environment env) |
abstract TemplateScalarModel |
TruncateBuiltinAlgorithm.truncateW(java.lang.String s,
int maxLength,
TemplateScalarModel terminator,
java.lang.Integer terminatorLength,
Environment env)
Corresponds to
?truncate_w(...) in templates. |
TemplateScalarModel |
DefaultTruncateBuiltinAlgorithm.truncateW(java.lang.String s,
int maxLength,
TemplateScalarModel terminator,
java.lang.Integer terminatorLength,
Environment env) |
abstract TemplateModel |
TruncateBuiltinAlgorithm.truncateWM(java.lang.String s,
int maxLength,
TemplateModel terminator,
java.lang.Integer terminatorLength,
Environment env)
Corresponds to
?truncate_w_m(...) in templates. |
TemplateModel |
DefaultTruncateBuiltinAlgorithm.truncateWM(java.lang.String s,
int maxLength,
TemplateModel terminator,
java.lang.Integer terminatorLength,
Environment env) |
void |
Environment.visit(freemarker.core.TemplateElement element,
TemplateDirectiveModel directiveModel,
java.util.Map args,
java.util.List bodyParameterNames)
Deprecated.
Should be internal API
|
Modifier and Type | Class and Description |
---|---|
class |
InvalidPropertyException
An exception thrown when there is an attempt to access
an invalid bean property when we are in a "strict bean" mode
|
Modifier and Type | Method and Description |
---|---|
void |
IncludePage.execute(Environment env,
java.util.Map params,
TemplateModel[] loopVars,
TemplateDirectiveBody body) |
protected void |
FreemarkerServlet.processEnvironment(Environment env,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
This is the method that actually executes the template.
|
Modifier and Type | Class and Description |
---|---|
class |
TemplateModelException
ObjectWrapper -s may throw this when wrapping/unwrapping fails, or TemplateModel methods throw this
if the requested data can't be retrieved. |
Modifier and Type | Method and Description |
---|---|
void |
TemplateExceptionHandler.handleTemplateException(TemplateException te,
Environment env,
java.io.Writer out)
Method called after a
TemplateException was raised inside a template. |
void |
AttemptExceptionReporter.report(TemplateException te,
Environment env)
Called to log or otherwise report the error that has occurred inside an
#attempt block. |
Modifier and Type | Method and Description |
---|---|
Environment |
Template.createProcessingEnvironment(java.lang.Object dataModel,
java.io.Writer out)
|
Environment |
Template.createProcessingEnvironment(java.lang.Object dataModel,
java.io.Writer out,
ObjectWrapper wrapper)
Creates a
Environment object, using this template, the data-model provided as
parameter. |
protected void |
Configuration.doAutoImportsAndIncludes(Environment env) |
void |
TemplateDirectiveModel.execute(Environment env,
java.util.Map params,
TemplateModel[] loopVars,
TemplateDirectiveBody body)
Executes this user-defined directive; called by FreeMarker when the user-defined
directive is called in the template.
|
void |
TemplateExceptionHandler.handleTemplateException(TemplateException te,
Environment env,
java.io.Writer out)
Method called after a
TemplateException was raised inside a template. |
void |
Template.process(java.lang.Object dataModel,
java.io.Writer out)
Executes template, using the data-model provided, writing the generated output to the supplied
Writer . |
void |
Template.process(java.lang.Object dataModel,
java.io.Writer out,
ObjectWrapper wrapper)
Like
Template.process(Object, Writer) , but overrides the Configurable.getObjectWrapper() . |
void |
Template.process(java.lang.Object dataModel,
java.io.Writer out,
ObjectWrapper wrapper,
TemplateNodeModel rootNode)
Like
Template.process(Object, Writer) , but also sets a (XML-)node to be recursively processed by the template. |
void |
TemplateDirectiveBody.render(java.io.Writer out)
Renders the body of the directive body to the specified writer.
|
void |
Configuration.setSetting(java.lang.String name,
java.lang.String value) |