Package freemarker.ext.beans

Provides various model implementations for FM-Classic: reflection models, resource bundle model, and singleton boolean models.

See:
          Description

Class Summary
ArrayModel A class that will wrap an arbitrary array into TemplateHashModel, TemplateMethodModel2, TemplateIndexedModel and TemplateListModel2 interfaces.
BeansWrapper Utility class that provides generic services to reflection classes.
CollectionModel A special case of ObjectModel that supports the collection.iterator syntax to obtain a TemplateListModel2 instance backed by this collection.
EnumerationModel A class that adds TemplateListModel2 functionality to the Enumeration interface implementers.
IteratorModel A class that adds TemplateListModel2 functionality to the Iterator interface implementers.
ListModel A special case of CollectionModel that implements TemplateIndexedModel to allow gets using numbered indexes.
MapModel A special case of ObjectModel that adds implementation for TemplateMethodModel2 on map objects that is a shortcut for the Map.get() method.
MethodModel A class that will wrap a reflected method call into a TemplateMethodModel2 interface.
Models Various predefined singleton models.
NumberModel A class that will wrap a reflected parameterless method call into a TemplateNumberModel interface.
ObjectModel A class that will wrap an arbitrary object into TemplateHashModel interface.
ObjectModelBase Base class for all classes that wrap objects into template models.
ResourceBundleModel A hash model that wraps a resource bundle.
RootMapModel A wrapper for an arbitrary map that will expose it as a TemplateModelRoot.
ScalarModel A class that will wrap a reflected parameterless method call into a TemplateScalarModel interface.
SimpleNumberModel Holds subclasses of Number for evaluation as TemplateNumberModel or unwrapped as an object.
StaticModel Wraps the static fields and methods of a class in a TemplateHashModel.
StaticModels Utility class for instantiating StaticModel instances from templates.
 

Package freemarker.ext.beans Description

Provides various model implementations for FM-Classic: reflection models, resource bundle model, and singleton boolean models.

Most of the issues dealing with reflection are handled by the BeansWrapper.wrap(Object)and StaticModel.create(Class) methods. In normal cases, these are the only methods you should use to turn an arbitrary Java object into a FM-Classic TemplateModel. Additionally, you can manually create instance of any wrapper class using it's getInstance method (which canonicalizes instances, meaning you always get the same wrapper instance for an object), or using the new operator (which, by definition, always creates a new wrapper).

There are also two classes that are not part of the automatic wrapping implemented by the BeansWrapper class, therefore you must always create their instances manually: the RootMapModel and ResourceBundleModel class.

Note: Unsupported
This package no longer has a maintainer, and needs a lot of work to be actively maintained. The code is provided as a convenience, but any bugs encountered cannot be fixed in a timely manner.