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.jsp |
Classes for two-way FreeMarker-JSP integration.
|
freemarker.ext.jython |
Exposes Jython objects to templates.
|
freemarker.ext.rhino |
Exposes Rhino (ECMAScript) objects 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.ext.util |
Various classes used by
freemarker.ext but might be useful outside it too. |
freemarker.template |
The fundamental, most commonly used API-s of FreeMarker;
start with
Configuration (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.
|
Modifier and Type | Method and Description |
---|---|
ObjectWrapper |
Configurable.getObjectWrapper()
The getter pair of
Configurable.setObjectWrapper(ObjectWrapper) . |
Modifier and Type | Method and Description |
---|---|
void |
Configurable.setObjectWrapper(ObjectWrapper objectWrapper)
Sets the object wrapper used to wrap objects to
TemplateModel -s. |
Modifier and Type | Class and Description |
---|---|
class |
BeansWrapper
ObjectWrapper that is able to expose the Java API of arbitrary Java objects. |
Modifier and Type | Method and Description |
---|---|
ObjectWrapper |
BeansWrapperConfiguration.getOuterIdentity() |
ObjectWrapper |
BeansWrapper.getOuterIdentity()
By default returns this.
|
Modifier and Type | Method and Description |
---|---|
void |
BeansWrapperConfiguration.setOuterIdentity(ObjectWrapper outerIdentity)
See
BeansWrapper.setOuterIdentity(ObjectWrapper) , except here the default is null that means
the ObjectWrapper that you will set up with this BeansWrapperBuilder object. |
void |
BeansWrapper.setOuterIdentity(ObjectWrapper outerIdentity)
When wrapping an object, the BeansWrapper commonly needs to wrap
"sub-objects", for example each element in a wrapped collection.
|
Modifier and Type | Method and Description |
---|---|
ObjectWrapper |
TaglibFactory.getObjectWrapper()
|
Modifier and Type | Method and Description |
---|---|
void |
TaglibFactory.setObjectWrapper(ObjectWrapper objectWrapper)
Sets the
ObjectWrapper used when building the JSP tag library TemplateHashModel -s from the TLD-s. |
Modifier and Type | Class and Description |
---|---|
class |
JythonWrapper
An object wrapper that wraps Jython objects into FreeMarker template models
and vice versa.
|
Modifier and Type | Class and Description |
---|---|
class |
RhinoWrapper |
Modifier and Type | Method and Description |
---|---|
protected ObjectWrapper |
FreemarkerServlet.createDefaultObjectWrapper()
Override this to specify what the default
ObjectWrapper will be when the
object_wrapper Servlet init-param wasn't specified. |
protected ObjectWrapper |
FreemarkerServlet.createObjectWrapper()
Called from
FreemarkerServlet.init() to create the ObjectWrapper ; to customzie this aspect, in most cases you
should override FreemarkerServlet.createDefaultObjectWrapper() instead. |
ObjectWrapper |
HttpRequestHashModel.getObjectWrapper() |
protected ObjectWrapper |
FreemarkerServlet.getObjectWrapper()
Should be final; don't override it.
|
Modifier and Type | Method and Description |
---|---|
protected TemplateModel |
FreemarkerServlet.createModel(ObjectWrapper objectWrapper,
javax.servlet.ServletContext servletContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected TaglibFactory |
FreemarkerServlet.createTaglibFactory(ObjectWrapper objectWrapper,
javax.servlet.ServletContext servletContext)
Called to create the
TaglibFactory once per servlet context. |
Constructor and Description |
---|
AllHttpScopesHashModel(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,
javax.servlet.http.HttpServletResponse response,
ObjectWrapper wrapper) |
HttpRequestHashModel(javax.servlet.http.HttpServletRequest request,
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.
|
Modifier and Type | Method and Description |
---|---|
TemplateModel |
ModelFactory.create(java.lang.Object object,
ObjectWrapper wrapper)
Create a wrapping model for the specified object that belongs to
the specified wrapper.
|
Modifier and Type | Interface and Description |
---|---|
interface |
ObjectWrapperAndUnwrapper
Experimental - subject to change: Adds functionality to
ObjectWrapper that creates a plain Java object
from a TemplateModel . |
Modifier and Type | Class and Description |
---|---|
class |
DefaultObjectWrapper
The default implementation of the
ObjectWrapper interface. |
class |
SimpleObjectWrapper
A restricted object wrapper that will not expose arbitrary object, just those that directly correspond to the
TemplateModel sub-interfaces (String , Map and such). |
Modifier and Type | Field and Description |
---|---|
static ObjectWrapper |
ObjectWrapper.BEANS_WRAPPER
Deprecated.
Use
BeansWrapperBuilder.build() instead; this instance isn't read-only
and thus can't be trusted. |
static ObjectWrapper |
ObjectWrapper.DEFAULT_WRAPPER
Deprecated.
Use
DefaultObjectWrapperBuilder.build() instead; this instance isn't read-only and thus can't
be trusted. |
static ObjectWrapper |
ObjectWrapper.SIMPLE_WRAPPER
Deprecated.
No replacement as it was seldom if ever used by anyone; this instance isn't
read-only and thus can't be trusted.
|
Modifier and Type | Method and Description |
---|---|
static ObjectWrapper |
WrappingTemplateModel.getDefaultObjectWrapper()
Deprecated.
Don't depend on this object, as it can be replace by anybody in the same JVM.
|
static ObjectWrapper |
Configuration.getDefaultObjectWrapper(Version incompatibleImprovements)
Returns the default object wrapper for a given "incompatible_improvements" version.
|
ObjectWrapper |
WrappingTemplateModel.getObjectWrapper()
Returns the object wrapper instance used by this wrapping template model.
|
Modifier and Type | Method and Description |
---|---|
static DefaultEnumerationAdapter |
DefaultEnumerationAdapter.adapt(java.util.Enumeration<?> enumeration,
ObjectWrapper wrapper)
Factory method for creating new adapter instances.
|
static DefaultIteratorAdapter |
DefaultIteratorAdapter.adapt(java.util.Iterator iterator,
ObjectWrapper wrapper)
Factory method for creating new adapter instances.
|
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. |
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. |
static void |
WrappingTemplateModel.setDefaultObjectWrapper(ObjectWrapper objectWrapper)
Deprecated.
This method has VM-wide effect, which makes it unsuitable for application where multiple components
might use FreeMarker internally.
|
void |
WrappingTemplateModel.setObjectWrapper(ObjectWrapper objectWrapper) |
void |
Configuration.setObjectWrapper(ObjectWrapper objectWrapper) |
Constructor and Description |
---|
MapKeyValuePairIterator(java.util.Map<?,?> map,
ObjectWrapper objectWrapper) |
SimpleCollection(java.util.Collection collection,
ObjectWrapper wrapper)
Same as
SimpleCollection.SimpleCollection(Iterable, ObjectWrapper) ; kept for binary compatibility. |
SimpleCollection(java.lang.Iterable iterable,
ObjectWrapper wrapper) |
SimpleCollection(java.util.Iterator iterator,
ObjectWrapper wrapper) |
SimpleHash(java.util.Map<java.lang.String,java.lang.Object> directMap,
ObjectWrapper wrapper,
int overloadDistinction)
Creates an instance that will use the specified
Map directly as its backing store; beware, the
Map will be possibly modified by SimpleHash , even if you only read the SimpleHash . |
SimpleHash(java.util.Map map,
ObjectWrapper wrapper)
Creates a new hash by shallow-coping (possibly cloning) the underlying map; in many applications you should use
DefaultMapAdapter instead. |
SimpleHash(ObjectWrapper wrapper)
Creates an empty simple hash using the specified object wrapper.
|
SimpleSequence(java.util.Collection collection,
ObjectWrapper wrapper)
Constructs a simple sequence that will contain the elements from the specified
Collection ; consider
using DefaultListAdapter instead. |
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.
|
WrappingTemplateModel(ObjectWrapper objectWrapper)
Protected constructor that creates a new wrapping template model using the specified object wrapper.
|
Modifier and Type | Interface and Description |
---|---|
interface |
ObjectWrapperWithAPISupport
Experimental - subject to change: Implemented by
ObjectWrapper -s to help TemplateModel -s to
implement the someValue?api operation. |
interface |
RichObjectWrapper
Experimental - subject to change: Union of the interfaces that a typical feature rich
ObjectWrapper is
expected to implement. |
Modifier and Type | Method and Description |
---|---|
static TemplateHashModel |
TemplateModelUtils.wrapAsHashUnion(ObjectWrapper objectWrapper,
java.util.List<?> hashLikeObjects)
Creates a
TemplateHashModel that is the union of the hash-like objects passed in as argument. |
static TemplateHashModel |
TemplateModelUtils.wrapAsHashUnion(ObjectWrapper objectWrapper,
java.lang.Object... hashLikeObjects)
Same as
TemplateModelUtils.wrapAsHashUnion(ObjectWrapper, List) , but uses a varargs parameter instead of a List . |