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 classfreemarker.core._MiscTemplateExceptionstatic classConfigurable.SettingValueAssignmentExceptionThe setting name was recognized, but its value couldn't be parsed or the setting couldn't be set for some other reason.static classConfigurable.UnknownSettingExceptionThe setting name was not recognized.classInvalidReferenceExceptionA subclass ofTemplateExceptionthat says that an FTL expression has evaluated tonullor it refers to something that doesn't exist.classNonBooleanExceptionIndicates that aTemplateBooleanModelvalue was expected, but the value had a different type.classNonDateExceptionIndicates that aTemplateDateModelvalue was expected, but the value had a different type.classNonExtendedHashExceptionIndicates that aTemplateHashModelExvalue was expected, but the value had a different type.classNonExtendedNodeExceptionIndicates that aTemplateNodeModelExvalue was expected, but the value had a different type.classNonHashExceptionIndicates that aTemplateHashModelvalue was expected, but the value had a different type.classNonMarkupOutputExceptionIndicates that aTemplateMarkupOutputModelvalue was expected, but the value had a different type.classNonMethodExceptionIndicates that aTemplateMethodModelvalue was expected, but the value had a different type.classNonNodeExceptionIndicates that aTemplateNodeModelvalue was expected, but the value had a different type.classNonNumericalExceptionIndicates that aTemplateNumberModelvalue was expected, but the value had a different type.classNonSequenceExceptionIndicates that aTemplateSequenceModelvalue was expected, but the value had a different type.classNonSequenceOrCollectionExceptionIndicates that aTemplateSequenceModelorTemplateCollectionModelvalue was expected, but the value had a different type.classNonStringExceptionIndicates that aTemplateScalarModelvalue was expected (or maybe something that can be automatically coerced to that), but the value had a different type.classNonStringOrTemplateOutputExceptionIndicates that aTemplateScalarModel(or maybe something that can be automatically coerced to that) orTemplateMarkupOutputModelvalue was expected, but the value had a different type.classStopExceptionThis exception is thrown when a #stop directive is encountered.classUnexpectedTypeExceptionThe type of a value differs from what was expected.Methods in freemarker.core that return TemplateException Modifier and Type Method Description protected TemplateExceptionConfigurable. invalidSettingValueException(java.lang.String name, java.lang.String value)protected TemplateExceptionConfigurable. settingValueAssignmentException(java.lang.String name, java.lang.String value, java.lang.Throwable cause)protected TemplateExceptionConfigurable. 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 voidEnvironment. __setitem__(java.lang.String key, java.lang.Object o)A hook that Jython uses.abstract java.lang.NumberArithmeticEngine. add(java.lang.Number first, java.lang.Number second)java.lang.NumberArithmeticEngine.ConservativeEngine. add(java.lang.Number first, java.lang.Number second)booleanEnvironment. applyEqualsOperator(TemplateModel leftValue, TemplateModel rightValue)Compares twoTemplateModel-s according the rules of the FTL "==" operator.booleanEnvironment. 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.booleanEnvironment. applyGreaterThanOperator(TemplateModel leftValue, TemplateModel rightValue)Compares twoTemplateModel-s according the rules of the FTL ">" operator.booleanEnvironment. applyLessThanOperator(TemplateModel leftValue, TemplateModel rightValue)Compares twoTemplateModel-s according the rules of the FTL "<" operator.booleanEnvironment. applyLessThanOrEqualsOperator(TemplateModel leftValue, TemplateModel rightValue)Compares twoTemplateModel-s according the rules of the FTL "<" operator.booleanEnvironment. applyWithGreaterThanOrEqualsOperator(TemplateModel leftValue, TemplateModel rightValue)Compares twoTemplateModel-s according the rules of the FTL ">=" operator.abstract intArithmeticEngine. compareNumbers(java.lang.Number first, java.lang.Number second)intArithmeticEngine.ConservativeEngine. compareNumbers(java.lang.Number first, java.lang.Number second)java.lang.NumberArithmeticEngine.ConservativeEngine. divide(java.lang.Number first, java.lang.Number second)abstract java.lang.NumberArithmeticEngine. divide(java.lang.Number first, java.lang.Number second)protected voidConfigurable. doAutoImportsAndIncludes(Environment env)Executes the auto-imports and auto-includes for the main template of this environment.Environment.NamespaceEnvironment. importLib(Template loadedTemplate, java.lang.String targetNsVarName)Does what the#importdirective does, but with an already loaded template.Environment.NamespaceEnvironment. importLib(java.lang.String templateName, java.lang.String targetNsVarName)Emulatesimportdirective, except thattemplateNamemust be template root relative.Environment.NamespaceEnvironment. 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.voidEnvironment. include(Template includedTemplate)Processes a Template in the context of thisEnvironment, including its output in theEnvironment's Writer.voidEnvironment. include(java.lang.String name, java.lang.String encoding, boolean parse)Emulatesincludedirective, except thatnamemust be template root relative.java.lang.NumberArithmeticEngine.ConservativeEngine. modulus(java.lang.Number first, java.lang.Number second)abstract java.lang.NumberArithmeticEngine. modulus(java.lang.Number first, java.lang.Number second)java.lang.NumberArithmeticEngine.ConservativeEngine. multiply(java.lang.Number first, java.lang.Number second)abstract java.lang.NumberArithmeticEngine. multiply(java.lang.Number first, java.lang.Number second)voidEnvironment. process()Processes the template to which this environment belongs to.java.lang.ClassOptInTemplateClassResolver. resolve(java.lang.String className, Environment env, Template template)java.lang.ClassTemplateClassResolver. resolve(java.lang.String className, Environment env, Template template)Gets aClassbased on the class name.voidConfigurable. setSetting(java.lang.String name, java.lang.String value)Sets a FreeMarker setting by a name and string value.voidConfigurable. setSettings(java.io.InputStream propsIn)Reads a setting list (key and element pairs) from the input stream.voidConfigurable. setSettings(java.util.Properties props)Set the settings stored in aPropertiesobject.java.lang.NumberArithmeticEngine.ConservativeEngine. subtract(java.lang.Number first, java.lang.Number second)abstract java.lang.NumberArithmeticEngine. subtract(java.lang.Number first, java.lang.Number second)TemplateScalarModelDefaultTruncateBuiltinAlgorithm. truncate(java.lang.String s, int maxLength, TemplateScalarModel terminator, java.lang.Integer terminatorLength, Environment env)abstract TemplateScalarModelTruncateBuiltinAlgorithm. truncate(java.lang.String s, int maxLength, TemplateScalarModel terminator, java.lang.Integer terminatorLength, Environment env)Corresponds to?truncate(...)in templates.TemplateScalarModelDefaultTruncateBuiltinAlgorithm. truncateC(java.lang.String s, int maxLength, TemplateScalarModel terminator, java.lang.Integer terminatorLength, Environment env)abstract TemplateScalarModelTruncateBuiltinAlgorithm. truncateC(java.lang.String s, int maxLength, TemplateScalarModel terminator, java.lang.Integer terminatorLength, Environment env)Corresponds to?truncate_c_m(...)in templates.TemplateModelDefaultTruncateBuiltinAlgorithm. truncateCM(java.lang.String s, int maxLength, TemplateModel terminator, java.lang.Integer terminatorLength, Environment env)abstract TemplateModelTruncateBuiltinAlgorithm. truncateCM(java.lang.String s, int maxLength, TemplateModel terminator, java.lang.Integer terminatorLength, Environment env)Corresponds to?truncate_c_m(...)in templates.TemplateModelDefaultTruncateBuiltinAlgorithm. truncateM(java.lang.String s, int maxLength, TemplateModel terminator, java.lang.Integer terminatorLength, Environment env)abstract TemplateModelTruncateBuiltinAlgorithm. truncateM(java.lang.String s, int maxLength, TemplateModel terminator, java.lang.Integer terminatorLength, Environment env)Corresponds to?truncate_m(...)in templates.TemplateScalarModelDefaultTruncateBuiltinAlgorithm. truncateW(java.lang.String s, int maxLength, TemplateScalarModel terminator, java.lang.Integer terminatorLength, Environment env)abstract TemplateScalarModelTruncateBuiltinAlgorithm. truncateW(java.lang.String s, int maxLength, TemplateScalarModel terminator, java.lang.Integer terminatorLength, Environment env)Corresponds to?truncate_w(...)in templates.TemplateModelDefaultTruncateBuiltinAlgorithm. truncateWM(java.lang.String s, int maxLength, TemplateModel terminator, java.lang.Integer terminatorLength, Environment env)abstract TemplateModelTruncateBuiltinAlgorithm. truncateWM(java.lang.String s, int maxLength, TemplateModel terminator, java.lang.Integer terminatorLength, Environment env)Corresponds to?truncate_w_m(...)in templates.voidEnvironment. 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 classInvalidPropertyExceptionAn 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 voidIncludePage. execute(Environment env, java.util.Map params, TemplateModel[] loopVars, TemplateDirectiveBody body)protected voidFreemarkerServlet. 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 classTemplateModelExceptionObjectWrapper-s may throw this when wrapping/unwrapping fails, orTemplateModelmethods throw this if the requested data can't be retrieved.Methods in freemarker.template with parameters of type TemplateException Modifier and Type Method Description voidTemplateExceptionHandler. handleTemplateException(TemplateException te, Environment env, java.io.Writer out)Method called after aTemplateExceptionwas raised inside a template.voidAttemptExceptionReporter. report(TemplateException te, Environment env)Called to log or otherwise report the error that has occurred inside an#attemptblock.Methods in freemarker.template that throw TemplateException Modifier and Type Method Description EnvironmentTemplate. createProcessingEnvironment(java.lang.Object dataModel, java.io.Writer out)EnvironmentTemplate. createProcessingEnvironment(java.lang.Object dataModel, java.io.Writer out, ObjectWrapper wrapper)Creates aEnvironmentobject, using this template, the data-model provided as parameter.protected voidConfiguration. doAutoImportsAndIncludes(Environment env)voidTemplateDirectiveModel. 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.voidTemplateExceptionHandler. handleTemplateException(TemplateException te, Environment env, java.io.Writer out)Method called after aTemplateExceptionwas raised inside a template.voidTemplate. process(java.lang.Object dataModel, java.io.Writer out)Executes template, using the data-model provided, writing the generated output to the suppliedWriter.voidTemplate. process(java.lang.Object dataModel, java.io.Writer out, ObjectWrapper wrapper)LikeTemplate.process(Object, Writer), but overrides theConfigurable.getObjectWrapper().voidTemplate. 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.voidTemplateDirectiveBody. render(java.io.Writer out)Renders the body of the directive body to the specified writer.voidConfiguration. setSetting(java.lang.String name, java.lang.String value)
-