Uses of Class
freemarker.template.TemplateModelException
-
Packages that use TemplateModelException Package Description freemarker.core The seldom used or advanced parts of the fundamental FreeMarker API, compared tofreemarker.template.freemarker.debug Debugging API; experimental status, might change! This is to support debugging in IDE-s.freemarker.ext.beans The default object wrapper of FreeMarker uses this to expose Java Beans and POJO-s to templates.freemarker.ext.dom Exposes DOM XML nodes to templates as easily traversable trees; see in the Manual.freemarker.ext.jdom Deprecated, use W3C DOM (freemarker.ext.dom) instead; Exposes JDOM XML nodes to templates.freemarker.ext.jsp Classes for two-way FreeMarker-JSP integration.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.ext.xml Deprecated, use W3C DOM withfreemarker.ext.dominstead; Exposes XML from DOM, dom4j or JDOM nodes, uniformly.freemarker.template The fundamental, most commonly used API-s of FreeMarker; start withConfiguration(see also the Getting Started in the Manual.)freemarker.template.utility Various classes used by core FreeMarker code but might be useful outside of it too. -
-
Uses of TemplateModelException in freemarker.core
Methods in freemarker.core that throw TemplateModelException Modifier and Type Method Description java.lang.ObjectEnvironment. __getitem__(java.lang.String key)A hook that Jython uses.MOCommonMarkupOutputFormat. concat(MO mo1, MO mo2)abstract MOMarkupOutputFormat. concat(MO mo1, MO mo2)Returns aTemplateMarkupOutputModelthat contains the content of bothTemplateMarkupOutputModelobjects concatenated.java.lang.StringCombinedMarkupOutputFormat. escapePlainText(java.lang.String plainTextContent)abstract java.lang.StringMarkupOutputFormat. escapePlainText(java.lang.String plainTextContent)Should give the same result asMarkupOutputFormat.fromPlainTextByEscaping(String)and thenMarkupOutputFormat.getMarkupString(TemplateMarkupOutputModel), but the implementation may uses a more efficient solution.java.lang.ObjectTemplateDateFormat. format(TemplateDateModel dateModel)Formats the model to markup instead of to plain text if the result markup will be more than just plain text escaped, otherwise falls back to formatting to plain text.java.lang.ObjectTemplateNumberFormat. format(TemplateNumberModel numberModel)Formats the model to markup instead of to plain text if the result markup will be more than just plain text escaped, otherwise falls back to formatting to plain text.abstract java.lang.StringTemplateDateFormat. formatToPlainText(TemplateDateModel dateModel)abstract java.lang.StringTemplateNumberFormat. formatToPlainText(TemplateNumberModel numberModel)MOCommonMarkupOutputFormat. fromMarkup(java.lang.String markupText)abstract MOMarkupOutputFormat. fromMarkup(java.lang.String markupText)Wraps aStringthat's already markup toTemplateMarkupOutputModelinterface, to indicate its format.MOCommonMarkupOutputFormat. fromPlainTextByEscaping(java.lang.String textToEsc)abstract MOMarkupOutputFormat. fromPlainTextByEscaping(java.lang.String textToEsc)Converts aStringthat's assumed to be plain text toTemplateMarkupOutputModel, by escaping any special characters in the plain text.TemplateModelEnvironment. getDataModelOrSharedVariable(java.lang.String name)Returns the variable from the data-model, or if it's not there, then from the Configuration.setSharedVariables(Map) shared variables}TemplateModelEnvironment. getGlobalVariable(java.lang.String name)Returns the globally visible variable of the given name, ornull.java.util.SetEnvironment. getKnownVariableNames()Returns a set of variable names that are known at the time of call.TemplateModelEnvironment. getLocalVariable(java.lang.String name)Returns the loop or macro local variable corresponding to this variable name.java.lang.StringCommonMarkupOutputFormat. getMarkupString(MO mo)abstract java.lang.StringMarkupOutputFormat. getMarkupString(MO mo)Returns the content as markup text; nevernull.protected intDefaultTruncateBuiltinAlgorithm. getMTerminatorLength(TemplateMarkupOutputModel<?> mTerminator)Returns the (estimated) length of the argument terminator.protected booleanDefaultTruncateBuiltinAlgorithm. getMTerminatorRemovesDots(TemplateMarkupOutputModel terminator)Same asDefaultTruncateBuiltinAlgorithm.getTerminatorRemovesDots(String), but invoked for a markup terminator.static java.util.DateTemplateFormatUtil. getNonNullDate(TemplateDateModel dateModel)Utility method to extract theDatefrom anTemplateDateModel, and throwTemplateModelExceptionwith a standard error message if that'snull.static java.lang.NumberTemplateFormatUtil. getNonNullNumber(TemplateNumberModel numberModel)Utility method to extract theNumberfrom anTemplateNumberModel, and throwsTemplateModelExceptionwith a standard error message if that'snull.java.lang.StringCommonMarkupOutputFormat. getSourcePlainText(MO mo)abstract java.lang.StringMarkupOutputFormat. getSourcePlainText(MO mo)If thisTemplateMarkupOutputModelwas created withMarkupOutputFormat.fromPlainTextByEscaping(String), it returns the original plain text, otherwise it returnsnull.protected booleanDefaultTruncateBuiltinAlgorithm. getTerminatorRemovesDots(java.lang.String terminator)Tells if the dots touched by the terminator text should be removed.TemplateModelEnvironment. getVariable(java.lang.String name)Returns the variable that is visible in this context, ornullif the variable is not found.booleanCommonMarkupOutputFormat. isEmpty(MO mo)abstract booleanMarkupOutputFormat. isEmpty(MO mo)Returns if the markup is empty (0 length).booleanCombinedMarkupOutputFormat. isLegacyBuiltInBypassed(java.lang.String builtInName)abstract booleanMarkupOutputFormat. isLegacyBuiltInBypassed(java.lang.String builtInName)Tells if a string built-in that can't handle aTemplateMarkupOutputModelleft hand operand can bypass this object as is.protected abstract MOCommonMarkupOutputFormat. newTemplateMarkupOutputModel(java.lang.String plainTextContent, java.lang.String markupContent)Creates a newCommonTemplateMarkupOutputModelthat's bound to thisOutputFormatinstance.voidCombinedMarkupOutputFormat. output(java.lang.String textToEsc, java.io.Writer out)abstract voidCommonMarkupOutputFormat. output(java.lang.String textToEsc, java.io.Writer out)voidCommonMarkupOutputFormat. output(MO mo, java.io.Writer out)voidHTMLOutputFormat. output(java.lang.String textToEsc, java.io.Writer out)abstract voidMarkupOutputFormat. output(java.lang.String textToEsc, java.io.Writer out)Equivalent to callingMarkupOutputFormat.fromPlainTextByEscaping(String)and thenMarkupOutputFormat.output(TemplateMarkupOutputModel, Writer), but the implementation may uses a more efficient solution.abstract voidMarkupOutputFormat. output(MO mo, java.io.Writer out)Prints the parameter model to the output.voidRTFOutputFormat. output(java.lang.String textToEsc, java.io.Writer out)voidXHTMLOutputFormat. output(java.lang.String textToEsc, java.io.Writer out)voidXMLOutputFormat. output(java.lang.String textToEsc, java.io.Writer out) -
Uses of TemplateModelException in freemarker.debug
Methods in freemarker.debug that throw TemplateModelException Modifier and Type Method Description DebugModelDebugModel. get(int index)DebugModel[]DebugModel. get(int fromIndex, int toIndex)DebugModelDebugModel. get(java.lang.String key)DebugModel[]DebugModel. get(java.lang.String[] keys)booleanDebugModel. getAsBoolean()java.util.DateDebugModel. getAsDate()java.lang.NumberDebugModel. getAsNumber()java.lang.StringDebugModel. getAsString()DebugModel[]DebugModel. getCollection()intDebugModel. getDateType()java.lang.String[]DebugModel. keys()intDebugModel. size() -
Uses of TemplateModelException in freemarker.ext.beans
Subclasses of TemplateModelException 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" modeMethods in freemarker.ext.beans that throw TemplateModelException Modifier and Type Method Description java.lang.ObjectMapModel. exec(java.util.List arguments)The first argument is used as a key to call the map's get method.java.lang.ObjectOverloadedMethodsModel. exec(java.util.List arguments)Invokes the method, passing it the arguments from the list.java.lang.ObjectResourceBundleModel. exec(java.util.List arguments)Takes first argument as a resource key, looks up a string in resource bundle with this key, then applies a MessageFormat.format on the string with the rest of the arguments.java.lang.ObjectSimpleMapModel. exec(java.util.List args)java.lang.ObjectSimpleMethodModel. exec(java.util.List arguments)Invokes the method, passing it the arguments from the list.TemplateModelArrayModel. get(int index)TemplateModelBeanModel. get(java.lang.String key)Uses Beans introspection to locate a property or method with name matching the key name.TemplateModelCollectionModel. get(int index)Retrieves the i-th object from the collection, wrapped as a TemplateModel.TemplateModelOverloadedMethodsModel. get(int index)TemplateModelSimpleMapModel. get(java.lang.String key)TemplateModelSimpleMethodModel. get(int index)TemplateModelBeanModel. getAPI()TemplateModelSimpleMapModel. getAPI()protected TemplateModelBeanModel. invokeGenericGet(java.util.Map classInfo, java.lang.Class<?> clazz, java.lang.String key)protected TemplateModelMapModel. invokeGenericGet(java.util.Map keyMap, java.lang.Class clazz, java.lang.String key)Overridden to invoke the generic get method by casting to Map instead of through reflection - should yield better performance.protected TemplateModelResourceBundleModel. invokeGenericGet(java.util.Map keyMap, java.lang.Class clazz, java.lang.String key)Overridden to invoke the getObject method of the resource bundle.protected TemplateModelBeansWrapper. invokeMethod(java.lang.Object object, java.lang.reflect.Method method, java.lang.Object[] args)Invokes the specified method, wrapping the return value.TemplateModelIteratorEnumerationModel. iterator()This allows the enumeration to be used in a <#list> block.TemplateModelIteratorIteratorModel. iterator()This allows the iterator to be used in a <#list> block.java.lang.ObjectBeansWrapper. newInstance(java.lang.Class<?> clazz, java.util.List arguments)Creates a new instance of the specified class using the method call logic of this object wrapper for calling the constructor.TemplateModelEnumerationModel. next()Calls underlyingEnumeration.nextElement()and wraps the result.TemplateModelIteratorModel. next()Calls underlyingIterator.next()and wraps the result.protected TemplateModelBeansWrapper. readField(java.lang.Object object, java.lang.reflect.Field field)Reads the specified field, returns its value asTemplateModel.intOverloadedMethodsModel. size()intSimpleMethodModel. size()java.lang.ObjectBeansWrapper. tryUnwrapTo(TemplateModel model, java.lang.Class<?> targetClass)protected java.lang.ObjectBeanModel. unwrap(TemplateModel model)java.lang.ObjectBeansWrapper. unwrap(TemplateModel model)Attempts to unwrap a model into underlying object.java.lang.ObjectBeansWrapper. unwrap(TemplateModel model, java.lang.Class<?> targetClass)Attempts to unwrap a model into an object of the desired class.TemplateCollectionModelBeanModel. values()protected TemplateModelBeanModel. wrap(java.lang.Object obj)TemplateModelBeansWrapper. wrap(java.lang.Object object)Wraps the object with a template model that is most specific for the object's class.TemplateHashModelBeansWrapper. wrapAsAPI(java.lang.Object obj) -
Uses of TemplateModelException in freemarker.ext.dom
Methods in freemarker.ext.dom that throw TemplateModelException Modifier and Type Method Description TemplateModelNodeModel. exec(java.util.List args)TemplateModelXPathSupport. executeQuery(java.lang.Object context, java.lang.String xpathQuery)TemplateModelNodeModel. get(java.lang.String key)TemplateNodeModelExNodeModel. getNextSibling()java.lang.StringNodeModel. getNodeType()TemplateNodeModelExNodeModel. getPreviousSibling() -
Uses of TemplateModelException in freemarker.ext.jdom
Methods in freemarker.ext.jdom that throw TemplateModelException Modifier and Type Method Description java.lang.ObjectNodeListModel. exec(java.util.List arguments)Deprecated.Applies an XPath expression to the node list and returns the resulting node list.TemplateModelNodeListModel. get(int i)Deprecated.Retrieves the i-th element of the node list.TemplateModelNodeListModel. get(java.lang.String key)Deprecated.Provides node list traversal as well as special functions: filtering by name, filtering by node type, shallow-copying, and duplicate removal.java.lang.StringNodeListModel. getAsString()Deprecated.This method returns the string resulting from concatenation of string representations of its nodes. -
Uses of TemplateModelException in freemarker.ext.jsp
Methods in freemarker.ext.jsp that throw TemplateModelException Modifier and Type Method Description TemplateModelTaglibFactory. get(java.lang.String taglibUri)Retrieves a JSP tag library identified by an URI. -
Uses of TemplateModelException in freemarker.ext.servlet
Methods in freemarker.ext.servlet that throw TemplateModelException Modifier and Type Method Description protected TemplateModelFreemarkerServlet. createModel(ObjectWrapper objectWrapper, javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected TaglibFactoryFreemarkerServlet. createTaglibFactory(ObjectWrapper objectWrapper, javax.servlet.ServletContext servletContext)Called to create theTaglibFactoryonce per servlet context.TemplateModelAllHttpScopesHashModel. get(java.lang.String key)TemplateModelHttpRequestHashModel. get(java.lang.String key)TemplateModelHttpSessionHashModel. get(java.lang.String key)TemplateModelServletContextHashModel. get(java.lang.String key)booleanHttpSessionHashModel. isEmpty() -
Uses of TemplateModelException in freemarker.ext.xml
Methods in freemarker.ext.xml that throw TemplateModelException Modifier and Type Method Description java.lang.ObjectNodeListModel. exec(java.util.List arguments)Deprecated.Evaluates an XPath expression on XML nodes in this model.TemplateModelNodeListModel. get(java.lang.String key)Deprecated.Returns a new NodeListModel containing the nodes that result from applying an operator to this model's nodes.java.lang.StringNodeListModel. getAsString()Deprecated.Returns the string representation of the wrapped nodes.TemplateSequenceModelNodeListModel. getChildNodes()Deprecated.java.lang.StringNodeListModel. getNodeName()Deprecated.java.lang.StringNodeListModel. getNodeNamespace()Deprecated.java.lang.StringNodeListModel. getNodeType()Deprecated.TemplateNodeModelNodeListModel. getParentNode()Deprecated. -
Uses of TemplateModelException in freemarker.template
Methods in freemarker.template that throw TemplateModelException Modifier and Type Method Description intTransformControl. afterBody()Called after the body has been evaluated.booleanDefaultNonListCollectionAdapter. contains(TemplateModel item)java.lang.ObjectTemplateMethodModel. exec(java.util.List arguments)Deprecated.Executes the method call.java.lang.ObjectTemplateMethodModelEx. exec(java.util.List arguments)Executes the method call.TemplateModelDefaultListAdapter. get(int index)TemplateModelDefaultMapAdapter. get(java.lang.String key)TemplateModelSimpleHash. get(java.lang.String key)TemplateModelSimpleSequence. get(int index)Returns the item at the specified index of the list.TemplateModelTemplateHashModel. get(java.lang.String key)Gets a TemplateModel from the hash.TemplateModelTemplateSequenceModel. get(int index)Retrieves the i-th template model in this sequence.TemplateModelDefaultEnumerationAdapter. getAPI()TemplateModelDefaultIterableAdapter. getAPI()TemplateModelDefaultIteratorAdapter. getAPI()TemplateModelDefaultListAdapter. getAPI()TemplateModelDefaultMapAdapter. getAPI()TemplateModelDefaultNonListCollectionAdapter. getAPI()TemplateModelTemplateModelWithAPISupport. getAPI()Returns the model that exposes the (Java) API of the value.booleanTemplateBooleanModel. getAsBoolean()java.util.DateTemplateDateModel. getAsDate()Returns the date value.java.lang.NumberTemplateNumberModel. getAsNumber()Returns the numeric value.java.lang.StringLocalizedString. getAsString()java.lang.StringTemplateScalarModel. getAsString()Returns theStringrepresentation of this model.TemplateSequenceModelTemplateNodeModel. getChildNodes()TemplateModelTemplateHashModelEx2.KeyValuePair. getKey()abstract java.lang.StringLocalizedString. getLocalizedString(java.util.Locale locale)java.lang.StringResourceBundleLocalizedString. getLocalizedString(java.util.Locale locale)TemplateNodeModelExTemplateNodeModelEx. getNextSibling()java.lang.StringTemplateNodeModel. getNodeName()java.lang.StringTemplateNodeModel. getNodeNamespace()java.lang.StringTemplateNodeModel. getNodeType()TemplateNodeModelTemplateNodeModel. getParentNode()TemplateNodeModelExTemplateNodeModelEx. getPreviousSibling()TemplateModelTemplateHashModelEx2.KeyValuePair. getValue()java.io.WriterTemplateTransformModel. getWriter(java.io.Writer out, java.util.Map args)Returns a writer that will be used by the engine to feed the transformation input to the transform.protected TemplateModelDefaultObjectWrapper. handleUnknownType(java.lang.Object obj)Called for an object that isn't considered to be of a "basic" Java type, like for an application specific type, or for a W3C DOM node.protected TemplateModelSimpleObjectWrapper. handleUnknownType(java.lang.Object obj)Called if a type other than the simple ones we know about is passed in.booleanTemplateHashModelEx2.KeyValuePairIterator. hasNext()Similar toIterator.hasNext().booleanTemplateModelIterator. hasNext()booleanTemplateCollectionModelEx. isEmpty()Returns if the collection contains any elements.booleanTemplateHashModel. isEmpty()TemplateModelIteratorDefaultEnumerationAdapter. iterator()TemplateModelIteratorDefaultIterableAdapter. iterator()TemplateModelIteratorDefaultIteratorAdapter. iterator()TemplateModelIteratorDefaultNonListCollectionAdapter. iterator()TemplateModelIteratorTemplateCollectionModel. iterator()Retrieves a template model iterator that is used to iterate over the elements in this collection.TemplateCollectionModelTemplateHashModelEx. keys()TemplateHashModelEx2.KeyValuePairIteratorTemplateHashModelEx2. keyValuePairIterator()TemplateHashModelEx2.KeyValuePairTemplateHashModelEx2.KeyValuePairIterator. next()Similar toIterator.next().TemplateModelTemplateModelIterator. next()Returns the next model.intTransformControl. onStart()Called before the body is evaluated for the first time.voidConfiguration. setAllSharedVariables(TemplateHashModelEx hash)Adds all object in the hash as shared variable to the configuration; it's like doing severalConfiguration.setSharedVariable(String, Object)calls, one for each hash entry.voidConfiguration. setSharedVariable(java.lang.String name, java.lang.Object value)Adds shared variable to the configuration; It usesConfigurable.getObjectWrapper()to wrap thevalue, so it's important that the object wrapper is set before this.voidConfiguration. setSharedVariables(java.util.Map<java.lang.String,?> map)Replaces all shared variables (removes all previously added ones).voidConfiguration. setSharedVaribles(java.util.Map map)Deprecated.UseConfiguration.setSharedVariables(Map)instead.intDefaultListAdapter. size()intTemplateCollectionModelEx. size()Returns the number items in this collection, orInteger.MAX_VALUE, if there are more thanInteger.MAX_VALUEitems.intTemplateHashModelEx. size()intTemplateSequenceModel. size()java.util.ListSimpleSequence. toList()Deprecated.No replacement exists; not a reliable way of getting back the original list elemnts.java.util.MapSimpleHash. toMap()Note that this method creates and returns a deep-copy of the underlying hash used internally.java.lang.ObjectObjectWrapperAndUnwrapper. tryUnwrapTo(TemplateModel tm, java.lang.Class<?> targetClass)Attempts to unwrap aTemplateModelto a plain Java object that's the instance of the given class (or isnull).java.lang.ObjectObjectWrapperAndUnwrapper. unwrap(TemplateModel tm)Unwraps aTemplateModelto a plain Java object.TemplateCollectionModelTemplateHashModelEx. values()TemplateModelDefaultObjectWrapper. wrap(java.lang.Object obj)Wraps the parameter object toTemplateModelinterface(s).TemplateModelObjectWrapper. wrap(java.lang.Object obj)Makes aTemplateModelout of a non-TemplateModelobject, usually by "wrapping" it into aTemplateModelimplementation that delegates to the original object.protected TemplateModelWrappingTemplateModel. wrap(java.lang.Object obj)Wraps the passed object into a template model using this object's object wrapper.TemplateHashModelSimpleObjectWrapper. wrapAsAPI(java.lang.Object obj)Constructors in freemarker.template that throw TemplateModelException Constructor Description SimpleSequence(TemplateCollectionModel tcm)Constructs a simple sequence from the passed collection model, which shouldn't be added to later. -
Uses of TemplateModelException in freemarker.template.utility
Methods in freemarker.template.utility that throw TemplateModelException Modifier and Type Method Description java.lang.ObjectExecute. exec(java.util.List arguments)Executes a method call.java.lang.ObjectObjectConstructor. exec(java.util.List args)TemplateModelDOMNodeModel. get(java.lang.String key)Deprecated.static TemplateHashModelEx2.KeyValuePairIteratorTemplateModelUtils. getKeyValuePairIterator(TemplateHashModelEx hash)TemplateModelUtils.TemplateHashModelExKeyValuePairIteratorthat even works for a non-TemplateHashModelEx2TemplateHashModelEx.java.io.WriterCaptureOutput. getWriter(java.io.Writer out, java.util.Map args)Deprecated.java.io.WriterStandardCompress. getWriter(java.io.Writer out, java.util.Map args)static java.lang.ObjectDeepUnwrap. permissiveUnwrap(TemplateModel model)Same asDeepUnwrap.unwrap(TemplateModel), but it doesn't throw exception if it doesn't know how to unwrap the model, but rather returns it as-is.static java.lang.ObjectDeepUnwrap. premissiveUnwrap(TemplateModel model)Deprecated.the name of this method is mistyped.static java.lang.ObjectDeepUnwrap. unwrap(TemplateModel model)UnwrapsTemplateModel-s recursively.TemplateHashModelObjectWrapperWithAPISupport. wrapAsAPI(java.lang.Object obj)Wraps an object to aTemplateModelthat exposes the object's "native" (usually, Java) API.static TemplateHashModelTemplateModelUtils. wrapAsHashUnion(ObjectWrapper objectWrapper, java.lang.Object... hashLikeObjects)Same asTemplateModelUtils.wrapAsHashUnion(ObjectWrapper, List), but uses a varargs parameter instead of aList.static TemplateHashModelTemplateModelUtils. wrapAsHashUnion(ObjectWrapper objectWrapper, java.util.List<?> hashLikeObjects)Creates aTemplateHashModelthat is the union of the hash-like objects passed in as argument.
-