# Package freemarker.template.utility

Various classes used by core FreeMarker code but might be useful outside of it too.

See: Description

Interface Summary
DateUtil.CalendarFieldsToDateConverter: Used internally by `DateUtil`; don't use its implementations for anything else.
DateUtil.DateToISO8601CalendarFactory: Used internally by `DateUtil`; don't use its implementations for anything else.
ObjectFactory<T>: Used for the trivial cases of the factory pattern.
ObjectWrapperWithAPISupport: Experimental - subject to change: Implemented by `ObjectWrapper`-s to help `TemplateModel`-s to implement the `someValue?api` operation.
RichObjectWrapper: Experimental - subject to change: Union of the interfaces that a typical feature rich `ObjectWrapper` is expected to implement.
WriteProtectable: Implemented by objects that can be made permanently read-only.

Class Summary
CaptureOutput: Deprecated Use block-assignments instead, like `<assign x>...</assign>`.
ClassUtil
Collections12: Deprecated Not needed anymore, as FreeMarker now requires higher than Java 1.3
CollectionUtils
Constants: Frequently used constant `TemplateModel` values.
DateUtil: Date and time related utilities.
DateUtil.TrivialCalendarFieldsToDateConverter: Non-thread-safe implementation that hard-references a calendar internally.
DateUtil.TrivialDateToISO8601CalendarFactory: Non-thread-safe factory that hard-references a calendar internally.
DeepUnwrap: Utility methods for unwrapping `TemplateModel`-s.
DOMNodeModel: A convenient wrapper class for wrapping a Node in the W3C DOM API.
Execute: Gives FreeMarker the the ability to execute external commands.
HtmlEscape: Performs an HTML escape of a given template fragment.
JythonRuntime: A crude first pass at an embeddable Jython interpreter
NormalizeNewlines: Transformer that supports FreeMarker legacy behavior: all newlines appearing within the transformed area will be transformed into the platform's default newline.
NullWriter: A `Writer` that simply drops what it gets.
NumberUtil: Number- and math-related utilities.
ObjectConstructor: An object that you can make available in a template to instantiate arbitrary beans-wrapped objects in a template.
OptimizerUtil
SecurityUtilities
StandardCompress: A filter that compresses each sequence of consecutive whitespace to a single line break (if the sequence contains a line break) or a single space.
StringUtil: Some text related utilities.
ToCanonical: Deprecated Will be removed (main method in a library, often classified as CWE-489 "Leftover Debug Code").
XmlEscape: Performs an XML escaping of a given template fragment.

Exception Summary
DateUtil.DateParseException
NullArgumentException: Indicates that an argument that must be non-`null` was `null`.
UndeclaredThrowableException: The equivalent of JDK 1.3 UndeclaredThrowableException.
UnrecognizedTimeZoneException: Indicates that the time zone name is not recognized.
UnsupportedNumberClassException: Thrown when FreeMarker runs into a `Number` subclass that it doesn't yet support.

## Package freemarker.template.utility Description

Various classes used by core FreeMarker code but might be useful outside of it too.