Uses of Class
freemarker.template.TemplateException
-
Packages that use TemplateException Package Description freemarker.core The seldom used or advanced parts of the fundamental FreeMarker API, compared tofreemarker.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 withConfiguration
(see also the Getting Started in the Manual.) -
-
Uses of TemplateException in freemarker.core
Subclasses of TemplateException in freemarker.core Modifier and Type Class 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 ofTemplateException
that says that an FTL expression has evaluated tonull
or it refers to something that doesn't exist.class
NonBooleanException
Indicates that aTemplateBooleanModel
value was expected, but the value had a different type.class
NonDateException
Indicates that aTemplateDateModel
value was expected, but the value had a different type.class
NonExtendedHashException
Indicates that aTemplateHashModelEx
value was expected, but the value had a different type.class
NonExtendedNodeException
Indicates that aTemplateNodeModelEx
value was expected, but the value had a different type.class
NonHashException
Indicates that aTemplateHashModel
value was expected, but the value had a different type.class
NonMarkupOutputException
Indicates that aTemplateMarkupOutputModel
value was expected, but the value had a different type.class
NonMethodException
Indicates that aTemplateMethodModel
value was expected, but the value had a different type.class
NonNodeException
Indicates that aTemplateNodeModel
value was expected, but the value had a different type.class
NonNumericalException
Indicates that aTemplateNumberModel
value was expected, but the value had a different type.class
NonSequenceException
Indicates that aTemplateSequenceModel
value was expected, but the value had a different type.class
NonSequenceOrCollectionException
Indicates that aTemplateSequenceModel
orTemplateCollectionModel
value was expected, but the value had a different type.class
NonStringException
Indicates that aTemplateScalarModel
value was expected (or maybe something that can be automatically coerced to that), but the value had a different type.class
NonStringOrTemplateOutputException
Indicates that aTemplateScalarModel
(or maybe something that can be automatically coerced to that) orTemplateMarkupOutputModel
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.Methods in freemarker.core that return TemplateException Modifier and Type Method 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.Methods in freemarker.core that throw TemplateException Modifier and Type Method 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 twoTemplateModel
-s according the rules of the FTL "==" operator.boolean
Environment. applyEqualsOperatorLenient(TemplateModel leftValue, TemplateModel rightValue)
Compares twoTemplateModel
-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 twoTemplateModel
-s according the rules of the FTL ">" operator.boolean
Environment. applyLessThanOperator(TemplateModel leftValue, TemplateModel rightValue)
Compares twoTemplateModel
-s according the rules of the FTL "<" operator.boolean
Environment. applyLessThanOrEqualsOperator(TemplateModel leftValue, TemplateModel rightValue)
Compares twoTemplateModel
-s according the rules of the FTL "<" operator.boolean
Environment. applyWithGreaterThanOrEqualsOperator(TemplateModel leftValue, TemplateModel rightValue)
Compares twoTemplateModel
-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)
java.lang.Number
ArithmeticEngine.ConservativeEngine. divide(java.lang.Number first, java.lang.Number second)
abstract java.lang.Number
ArithmeticEngine. 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(Template loadedTemplate, java.lang.String targetNsVarName)
Does what the#import
directive does, but with an already loaded template.Environment.Namespace
Environment. importLib(java.lang.String templateName, java.lang.String targetNsVarName)
Emulatesimport
directive, except thattemplateName
must be template root relative.Environment.Namespace
Environment. importLib(java.lang.String templateName, java.lang.String targetNsVarName, boolean lazy)
LikeEnvironment.importLib(String, String)
, but you can specify if you want a lazy import or not.void
Environment. include(Template includedTemplate)
Processes a Template in the context of thisEnvironment
, including its output in theEnvironment
's Writer.void
Environment. include(java.lang.String name, java.lang.String encoding, boolean parse)
Emulatesinclude
directive, except thatname
must be template root relative.java.lang.Number
ArithmeticEngine.ConservativeEngine. modulus(java.lang.Number first, java.lang.Number second)
abstract java.lang.Number
ArithmeticEngine. modulus(java.lang.Number first, java.lang.Number second)
java.lang.Number
ArithmeticEngine.ConservativeEngine. multiply(java.lang.Number first, java.lang.Number second)
abstract java.lang.Number
ArithmeticEngine. multiply(java.lang.Number first, java.lang.Number second)
void
Environment. process()
Processes the template to which this environment belongs to.java.lang.Class
OptInTemplateClassResolver. resolve(java.lang.String className, Environment env, Template template)
java.lang.Class
TemplateClassResolver. resolve(java.lang.String className, Environment env, Template template)
Gets aClass
based on the class name.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 aProperties
object.java.lang.Number
ArithmeticEngine.ConservativeEngine. subtract(java.lang.Number first, java.lang.Number second)
abstract java.lang.Number
ArithmeticEngine. subtract(java.lang.Number first, java.lang.Number second)
TemplateScalarModel
DefaultTruncateBuiltinAlgorithm. truncate(java.lang.String s, int maxLength, TemplateScalarModel terminator, java.lang.Integer terminatorLength, Environment env)
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. truncateC(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.TemplateModel
DefaultTruncateBuiltinAlgorithm. truncateCM(java.lang.String s, int maxLength, TemplateModel 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. truncateM(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.TemplateScalarModel
DefaultTruncateBuiltinAlgorithm. truncateW(java.lang.String s, int maxLength, TemplateScalarModel 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.TemplateModel
DefaultTruncateBuiltinAlgorithm. truncateWM(java.lang.String s, int maxLength, TemplateModel 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.void
Environment. visit(freemarker.core.TemplateElement element, TemplateDirectiveModel directiveModel, java.util.Map args, java.util.List bodyParameterNames)
Deprecated.Should be internal API -
Uses of TemplateException in freemarker.ext.beans
Subclasses of TemplateException in freemarker.ext.beans Modifier and Type Class 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 -
Uses of TemplateException in freemarker.ext.servlet
Methods in freemarker.ext.servlet that throw TemplateException Modifier and Type Method 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. -
Uses of TemplateException in freemarker.template
Subclasses of TemplateException in freemarker.template Modifier and Type Class Description class
TemplateModelException
ObjectWrapper
-s may throw this when wrapping/unwrapping fails, orTemplateModel
methods throw this if the requested data can't be retrieved.Methods in freemarker.template with parameters of type TemplateException Modifier and Type Method Description void
TemplateExceptionHandler. handleTemplateException(TemplateException te, Environment env, java.io.Writer out)
Method called after aTemplateException
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.Methods in freemarker.template that throw TemplateException Modifier and Type Method 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 aEnvironment
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 aTemplateException
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 suppliedWriter
.void
Template. process(java.lang.Object dataModel, java.io.Writer out, ObjectWrapper wrapper)
LikeTemplate.process(Object, Writer)
, but overrides theConfigurable.getObjectWrapper()
.void
Template. process(java.lang.Object dataModel, java.io.Writer out, ObjectWrapper wrapper, TemplateNodeModel rootNode)
LikeTemplate.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)
-