Uses of Interface
freemarker.template.ObjectWrapper
Packages that use ObjectWrapper
Package
Description
The seldom used or advanced parts of the fundamental FreeMarker API, compared to
freemarker.template.The default object wrapper of FreeMarker uses
this to expose Java Beans and POJO-s to templates.
Classes for two-way FreeMarker-JSP integration.
Servlet for legacy "Model 2" frameworks that allows using FreeMarker
templates instead of JSP as the MVC View
(see in the Manual).
Various classes used by
freemarker.ext but might be useful outside it too.The fundamental, most commonly used API-s of FreeMarker;
start with
Configuration (see also the
Getting Started in the Manual.)Various classes used by core FreeMarker code but might be useful outside of it too.
-
Uses of ObjectWrapper in freemarker.core
Methods in freemarker.core that return ObjectWrapperModifier and TypeMethodDescriptionConfigurable.getObjectWrapper()The getter pair ofConfigurable.setObjectWrapper(ObjectWrapper).Methods in freemarker.core with parameters of type ObjectWrapperModifier and TypeMethodDescriptionvoidConfigurable.setObjectWrapper(ObjectWrapper objectWrapper) Sets the object wrapper used to wrap objects toTemplateModel-s. -
Uses of ObjectWrapper in freemarker.ext.beans
Classes in freemarker.ext.beans that implement ObjectWrapperModifier and TypeClassDescriptionclassObjectWrapperthat is able to expose the Java API of arbitrary Java objects.Methods in freemarker.ext.beans that return ObjectWrapperModifier and TypeMethodDescriptionBeansWrapper.getOuterIdentity()By default returns this.BeansWrapperConfiguration.getOuterIdentity()Methods in freemarker.ext.beans with parameters of type ObjectWrapperModifier and TypeMethodDescriptionvoidBeansWrapper.setOuterIdentity(ObjectWrapper outerIdentity) When wrapping an object, the BeansWrapper commonly needs to wrap "sub-objects", for example each element in a wrapped collection.voidBeansWrapperConfiguration.setOuterIdentity(ObjectWrapper outerIdentity) SeeBeansWrapper.setOuterIdentity(ObjectWrapper), except here the default isnullthat means theObjectWrapperthat you will set up with thisBeansWrapperBuilderobject. -
Uses of ObjectWrapper in freemarker.ext.jsp
Methods in freemarker.ext.jsp that return ObjectWrapperMethods in freemarker.ext.jsp with parameters of type ObjectWrapperModifier and TypeMethodDescriptionvoidTaglibFactory.setObjectWrapper(ObjectWrapper objectWrapper) Sets theObjectWrapperused when building the JSP tag libraryTemplateHashModel-s from the TLD-s. -
Uses of ObjectWrapper in freemarker.ext.servlet
Methods in freemarker.ext.servlet that return ObjectWrapperModifier and TypeMethodDescriptionprotected ObjectWrapperFreemarkerServlet.createDefaultObjectWrapper()Override this to specify what the defaultObjectWrapperwill be when theobject_wrapperServlet init-param wasn't specified.protected ObjectWrapperFreemarkerServlet.createObjectWrapper()Called fromFreemarkerServlet.init()to create theObjectWrapper; to customzie this aspect, in most cases you should overrideFreemarkerServlet.createDefaultObjectWrapper()instead.protected ObjectWrapperFreemarkerServlet.getObjectWrapper()Should be final; don't override it.HttpRequestHashModel.getObjectWrapper()Methods in freemarker.ext.servlet with parameters of type ObjectWrapperModifier and TypeMethodDescriptionprotected 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.Constructors in freemarker.ext.servlet with parameters of type ObjectWrapperModifierConstructorDescriptionAllHttpScopesHashModel(ObjectWrapper objectWrapper, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request) Creates a new instance of AllHttpScopesHashModel for handling a single HTTP servlet request.HttpRequestHashModel(javax.servlet.http.HttpServletRequest request, ObjectWrapper wrapper) HttpRequestHashModel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ObjectWrapper wrapper) HttpSessionHashModel(FreemarkerServlet servlet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ObjectWrapper wrapper) Use this constructor when the session isn't already created.HttpSessionHashModel(javax.servlet.http.HttpSession session, ObjectWrapper wrapper) Use this constructor when the session already exists.ServletContextHashModel(javax.servlet.GenericServlet servlet, ObjectWrapper wrapper) ServletContextHashModel(javax.servlet.ServletContext servletctx, ObjectWrapper wrapper) Deprecated. -
Uses of ObjectWrapper in freemarker.ext.util
Methods in freemarker.ext.util with parameters of type ObjectWrapperModifier and TypeMethodDescriptionModelFactory.create(Object object, ObjectWrapper wrapper) Create a wrapping model for the specified object that belongs to the specified wrapper. -
Uses of ObjectWrapper in freemarker.template
Subinterfaces of ObjectWrapper in freemarker.templateModifier and TypeInterfaceDescriptioninterfaceExperimental - subject to change: Adds functionality toObjectWrapperthat creates a plain Java object from aTemplateModel.Classes in freemarker.template that implement ObjectWrapperModifier and TypeClassDescriptionclassThe default implementation of theObjectWrapperinterface.classA restricted object wrapper that will not expose arbitrary object, just those that directly correspond to theTemplateModelsub-interfaces (String,Mapand such).Fields in freemarker.template declared as ObjectWrapperModifier and TypeFieldDescriptionstatic final ObjectWrapperObjectWrapper.BEANS_WRAPPERDeprecated.UseBeansWrapperBuilder.build()instead; this instance isn't read-only and thus can't be trusted.static final ObjectWrapperObjectWrapper.DEFAULT_WRAPPERDeprecated.UseDefaultObjectWrapperBuilder.build()instead; this instance isn't read-only and thus can't be trusted.static final ObjectWrapperObjectWrapper.SIMPLE_WRAPPERDeprecated.No replacement as it was seldom if ever used by anyone; this instance isn't read-only and thus can't be trusted.Methods in freemarker.template that return ObjectWrapperModifier and TypeMethodDescriptionstatic ObjectWrapperConfiguration.getDefaultObjectWrapper(Version incompatibleImprovements) Returns the default object wrapper for a given "incompatible_improvements" version.static ObjectWrapperWrappingTemplateModel.getDefaultObjectWrapper()Deprecated.Don't depend on this object, as it can be replace by anybody in the same JVM.WrappingTemplateModel.getObjectWrapper()Returns the object wrapper instance used by this wrapping template model.Methods in freemarker.template with parameters of type ObjectWrapperModifier and TypeMethodDescriptionstatic DefaultEnumerationAdapterDefaultEnumerationAdapter.adapt(Enumeration<?> enumeration, ObjectWrapper wrapper) Factory method for creating new adapter instances.static DefaultIteratorAdapterDefaultIteratorAdapter.adapt(Iterator iterator, ObjectWrapper wrapper) Factory method for creating new adapter instances.Template.createProcessingEnvironment(Object dataModel, Writer out, ObjectWrapper wrapper) Creates aEnvironmentobject, using this template, the data-model provided as parameter.voidTemplate.process(Object dataModel, Writer out, ObjectWrapper wrapper) LikeTemplate.process(Object, Writer), but overrides theConfigurable.getObjectWrapper().voidTemplate.process(Object dataModel, Writer out, ObjectWrapper wrapper, TemplateNodeModel rootNode) LikeTemplate.process(Object, Writer), but also sets a (XML-)node to be recursively processed by the template.static voidWrappingTemplateModel.setDefaultObjectWrapper(ObjectWrapper objectWrapper) Deprecated.This method has VM-wide effect, which makes it unsuitable for application where multiple components might use FreeMarker internally.voidConfiguration.setObjectWrapper(ObjectWrapper objectWrapper) voidWrappingTemplateModel.setObjectWrapper(ObjectWrapper objectWrapper) Constructors in freemarker.template with parameters of type ObjectWrapperModifierConstructorDescriptionMapKeyValuePairIterator(Map<?, ?> map, ObjectWrapper objectWrapper) SimpleCollection(Iterable iterable, ObjectWrapper wrapper) SimpleCollection(Collection collection, ObjectWrapper wrapper) Same asSimpleCollection(Iterable, ObjectWrapper); kept for binary compatibility.SimpleCollection(Iterator iterator, ObjectWrapper wrapper) SimpleHash(ObjectWrapper wrapper) Creates an empty simple hash using the specified object wrapper.SimpleHash(Map<String, Object> directMap, ObjectWrapper wrapper, int overloadDistinction) Creates an instance that will use the specifiedMapdirectly as its backing store; beware, theMapwill be possibly modified bySimpleHash, even if you only read theSimpleHash.SimpleHash(Map map, ObjectWrapper wrapper) Creates a new hash by shallow-coping (possibly cloning) the underlying map; in many applications you should useDefaultMapAdapterinstead.SimpleSequence(int capacity, ObjectWrapper wrapper) Constructs an empty simple sequence with preallocated capacity.SimpleSequence(ObjectWrapper wrapper) Constructs an empty sequence using the specified object wrapper.SimpleSequence(Collection collection, ObjectWrapper wrapper) Constructs a simple sequence that will contain the elements from the specifiedCollection; consider usingDefaultListAdapterinstead.protectedWrappingTemplateModel(ObjectWrapper objectWrapper) Protected constructor that creates a new wrapping template model using the specified object wrapper. -
Uses of ObjectWrapper in freemarker.template.utility
Subinterfaces of ObjectWrapper in freemarker.template.utilityModifier and TypeInterfaceDescriptioninterfaceExperimental - subject to change: Implemented byObjectWrapper-s to helpTemplateModel-s to implement thesomeValue?apioperation.interfaceExperimental - subject to change: Union of the interfaces that a typical feature richObjectWrapperis expected to implement.Methods in freemarker.template.utility with parameters of type ObjectWrapperModifier and TypeMethodDescriptionstatic TemplateHashModelTemplateModelUtils.wrapAsHashUnion(ObjectWrapper objectWrapper, Object... hashLikeObjects) Same asTemplateModelUtils.wrapAsHashUnion(ObjectWrapper, List), but uses a varargs parameter instead of aList.static TemplateHashModelTemplateModelUtils.wrapAsHashUnion(ObjectWrapper objectWrapper, List<?> hashLikeObjects) Creates aTemplateHashModelthat is the union of the hash-like objects passed in as argument.
ServletContextHashModel(GenericServlet, ObjectWrapper)instead.