Package freemarker.template

Allows Java servlets and applications to generate HTML or other text-based pages based on templates, so that graphic design can be kept separate from application logic.

See:
          Description

Interface Summary
CacheListener An interface for classes that listen for CacheEvents.
Compileable Defines an interface for three ways of compiling a template: from an InputStream, and optionally, a character encoding.
FunctionTemplateProcessor Adds the ability to retrieve Template functions from a TemplateProcessor.
ListenerAdapter<O extends EventObject,L extends EventListener> An interface for adapters that GenericEventMulticaster can use to fire an event.
TemplateCache An interface for self-updating caches of compiled Template objects.
TemplateExceptionListener Interface for listening for TemplateExceptionEvents.
TemplateHashModel Hashes in a template data model must implement this interface.
TemplateIndexedModel Values that can be indexed by a numeric value must implement this interface.
TemplateIteratorModel Iterators that iterate over a TemplateListModel2 must implement this interface.
TemplateListModel Deprecated. This interface is not multi-thread safe, and also, in some cases, not single-thread safe either.
TemplateListModel2 List values in a template data model must implement either this interface or the deprecated TemplateListModel interface.
TemplateMethodModel Method calls in a template data model must implement either this interface or the TemplateMethodModel2 interface.
TemplateMethodModel2 Method calls in a template data model must implement either this interface or the TemplateMethodModel interface.
TemplateModel A template's data model must be a tree of objects, each of which implements a subinterface of TemplateModel.
TemplateModelRoot The root node of a template data model may implement this interface.
TemplateNumberModel Numeric values in a template data model must implement this interface.
TemplateObjectModel Simple interface for extracting the underlying object from a given template model.
TemplateProcessor Objects representing compiled templates must implement this interface.
TemplateRuntimeHandler Interface for handling events that occur during FM-Classic template runtime.
TemplateScalarModel Scalar values in a template data model must implement this interface.
TemplateTransformModel Transformations in a template data model must implement either this interface or the TemplateTransformModel2 interface.
TemplateTransformModel2 Transformations in a template data model must implement either this interface or the TemplateTransformModel interface.
TemplateWriteableHashModel Writeable hashes in a template data model must implement this interface.
TemplateWriteableIndexedModel Writeable values that can be indexed by a numeric value must implement this interface.
TemplateWriteableIteratorModel Writeable template iterator models that that iterate over a TemplateListModel2 must implement this interface.
TextEncoding Determines a character encoding to be used when retrieving a text file.
 

Class Summary
AbstractTemplate A base class from which Template implementations are subclassed.
BinaryData An application or servlet can instantiate a BinaryData to retrieve a binary file.
CacheEvent An event fired by self-updating caches.
FastBoolean An unsynchronised, immutable variation of the SimpleScalar class to handle boolean values.
FastHash<V extends TemplateModel> An unsynchronized variation of the SimpleHash class to handle key-pair values.
FastIndexedIterator An iterator that operates over a TemplateIndexedModel implementation.
FastIndexedWriteableIterator An iterator that operates over a TemplateIndexedModel implementation that also implements TemplateWriteableIndexedModel.
FastIterator Iterator class for FastList.
FastList<T extends TemplateModel> An unsynchronized variation of the SimpleList class.
FastListIterator<T extends TemplateModel> Iterator class for FastList where the underlying Collection is a List.
FastListRange A simple list model that represents a range of values.
FastNumber An unsynchronized, immutable implementation of the TemplateNumberModel interface.
FastScalar An unsynchronized, immutable variation of the SimpleScalar class.
FileInputSource Provides a file to be compiled into a FM-Classic template.
FileTemplateCache A TemplateCache that loads templates from a filesystem.
GenericEventMulticaster<E extends EventListener> A generic event multicaster class.
HtmlExceptionListener A basic handler that matches FreeMarker template legacy behaviour: any exceptions thrown by FM-Classic are output inside an HTML comment within the body of the output.
InputSource Provides an input stream or character stream to be compiled into a FM-Classic template.
LocalModelWrapper Wraps a template hash model with a template model root.
RootModelWrapper Wraps a template hash model with a template model root.
SimpleEventAdapter Adapter class for firing events that could happen at Template runtime.
SimpleHash A simple implementation of the TemplateHashModel and TemplateModelRoot interfaces, using an underlying Map.
SimpleList A simple implementation of the TemplateListModel2 interface, using an underlying List implementation.
SimpleNumber A simple implementation of the TemplateNumberModel interface using a long.
SimpleScalar A simple implementation of the TemplateScalarModel interface, using a String or a boolean.
StringInputSource Provides a String to be compiled into a FM-Classic template.
Template An application or servlet can instantiate a Template to compile and process an HTML template.
TemplateEventAdapter Adapter class for firing events that could happen at Template runtime.
TemplateExceptionEvent Event object that is thrown at runtime whenever an exceptional situation occurs.
UnparsedTemplate An UnparsedTemplate consists only of text.
 

Enum Summary
FileTemplateCache.Strategy Enumeration of caching strategies available to this cache.
TemplateProcessor.ExitStatus Enumates the return values from a template processor.
TemplateRuntimeHandler.Severity Enumerates the severity of a runtime template error.
 

Exception Summary
TemplateException The FM-Classic classes use this exception internally.
TemplateModelException Template model classes should throw this exception if requested data cannot be retrieved.
 

Package freemarker.template Description

Allows Java servlets and applications to generate HTML or other text-based pages based on templates, so that graphic design can be kept separate from application logic.

The source code for a template is typically an HTML document that contains instructions for including dynamically-generated data. These instructions are simple and unobtrusive (so the graphic designers can still do their work), but powerful enough to let you use data structures of arbitrary complexity. It's easy to generate tables of data, and you can use "if" and "switch" statements to generate conditional content.

The Template class compiles a template file into an efficient data structure for later use. A servlet can compile its template(s) in its init() method, then use the Template object(s) to process each request. Processing of compiled templates is very fast.

For complete instructions on how to use this package, please see the manual. Click here for notes on the source code.

Version:
1.9 beta 1
Author:
Benjamin Geer, Mike Bayer