Package freemarker.core
package freemarker.core
The seldom used or advanced parts of the fundamental FreeMarker API, compared to
freemarker.template
.
This package also encloses FreeMarker's core parsing/rendering functionality.-
InterfaceDescriptionGives information about the place where a directive is called from, also lets you attach a custom data object to that place.Don't implement this interface yourself; use the existing implementation(s).Used by built-ins and other template language features that get a class based on a string.TemplateMarkupOutputModel<MO extends TemplateMarkupOutputModel<MO>>"markup output" template language data-type; stores markup (some kind of "rich text" / structured format, as opposed to plain text) that meant to be printed as template output.Hooks to monitor as templates run.Information about the template element that we enter of exit; do NOT implement this (outside FreeMarker), as new methods can be added to this anytime!
-
ClassDescriptionDefines the methods in
CFormat
that are the same for all JSON-like languages.Creates an alias to another format, so that the format can be referred to with a simple name in the template, rather than as a concrete pattern or other kind of format string.Creates an alias to another format, so that the format can be referred to with a simple name in the template, rather than as a concrete pattern or other kind of format string.Used for implementing the arithmetic operations and number comparisons in the template language.This is the default arithmetic engine in FreeMarker.An arithmetic engine that conservatively widens the operation arguments to extent that they can hold the result of the operation.Defines a format (usually a computer language) that's used by thec
,cn
built-ins, and for the"c"
and"computer"
number_format
, and the"c"
boolean_format
.Represents two markup formats nested into each other.Deprecated.Will be removed (main method in a library, often classified as CWE-489 "Leftover Debug Code").Common superclass for implementingMarkupOutputFormat
-s that use aCommonTemplateMarkupOutputModel
subclass.CommonTemplateMarkupOutputModel<MO extends CommonTemplateMarkupOutputModel<MO>>Common superclass for implementingTemplateMarkupOutputModel
-s that belong to aCommonMarkupOutputFormat
subclass format.Represents the CSS output format (MIME type "text/css", name "CSS").The defaultTruncateBuiltinAlgorithm
implementation; seeConfigurable.setTruncateBuiltinAlgorithm(TruncateBuiltinAlgorithm)
.Object that represents the runtime environment during template processing.Deprecated.Will be removed, as Swing classes aren't accessible on Google App Engine.Represents the HTML output format (MIME type "text/html", name "HTML")."JavaScript"CFormat
, to be used when generating JavaScript (and not JSON), except, in most casesJavaScriptOrJSONCFormat
is recommended over this."JavaScript or JSON"CFormat
; for generating output that's compatible with both JSON and JavaScript.Represents the JavaScript output format (MIME type "application/javascript", name "JavaScript")."JSON"CFormat
; to be used when generating JSON (and not JavaScript), except, in most casesJavaScriptOrJSONCFormat
is recommended over this.Represents the JSON output format (MIME type "application/json", name "JSON").MarkupOutputFormat<MO extends TemplateMarkupOutputModel>Superclass ofOutputFormat
-s that represent a "markup" format, which is any format where certain character sequences have special meaning, and thus may need escaping.ATemplateClassResolver
that resolves only the classes whose name was specified in the constructor.Represents an output format.Represents the plain text output format (MIME type "text/plain", name "plainText").Represents the Rich Text Format output format (MIME type "application/rtf", name "RTF").Stores combined markup to be printed; used withCombinedMarkupOutputFormat
.Used for customizing the configuration settings for individualTemplate
-s (or rather groups of templates), relatively to the common setting values coming from theConfiguration
.Represents a date/time/dateTime format; used in templates for formatting and parsing with that format.Factory for a certain kind of date/time/dateTime formatting (TemplateDateFormat
).Utility classes for implementingTemplateValueFormat
-s.Stores HTML markup to be printed; used withHTMLOutputFormat
.Represents a number format; used in templates for formatting and parsing with that format.Factory for a certain kind of number formatting (TemplateNumberFormat
).Stores RTF markup to be printed; used withRTFOutputFormat
.Superclass of all value format objects; objects that convert values to strings, or parse strings.Superclass of all format factories.Stores HTML markup to be printed; used withHTMLOutputFormat
.Stores XML markup to be printed; used withXMLOutputFormat
.Used for implementing the "truncate" family of built-ins.Represents the output format used when the template output format is undecided.Represents the XML output format (MIME type "application/xhtml+xml", name "XHTML"); this behaves identically toHTMLOutputFormat
, except that the name an the MIME Type differs.Represents the XML output format (MIME type "application/xml", name "XML"). -
ExceptionDescriptionAn unexpected state was reached that is certainly caused by a bug in FreeMarker.The setting name was recognized, but its value couldn't be parsed or the setting couldn't be set for some other reason.The setting name was not recognized.Used when creating
TemplateDateFormat
-s andTemplateNumberFormat
-s to indicate that the parameters part of the format string (like some kind of pattern) is malformed.Used when creatingTemplateDateFormat
-s andTemplateNumberFormat
-s to indicate that the format string (like the value of thedateFormat
setting) is malformed.A subclass ofTemplateException
that says that an FTL expression has evaluated tonull
or it refers to something that doesn't exist.Indicates that aTemplateBooleanModel
value was expected, but the value had a different type.Indicates that aTemplateDateModel
value was expected, but the value had a different type.Indicates that aTemplateHashModelEx
value was expected, but the value had a different type.Indicates that aTemplateNodeModelEx
value was expected, but the value had a different type.Indicates that aTemplateHashModel
value was expected, but the value had a different type.Indicates that aTemplateMarkupOutputModel
value was expected, but the value had a different type.Indicates that aTemplateMethodModel
value was expected, but the value had a different type.Indicates that aTemplateNodeModel
value was expected, but the value had a different type.Indicates that aTemplateNumberModel
value was expected, but the value had a different type.Indicates that aTemplateSequenceModel
value was expected, but the value had a different type.Indicates that aTemplateSequenceModel
orTemplateCollectionModel
value was expected, but the value had a different type.Indicates that aTemplateScalarModel
value was expected (or maybe something that can be automatically coerced to that), but the value had a different type.Indicates that aTemplateScalarModel
(or maybe something that can be automatically coerced to that) orTemplateMarkupOutputModel
value was expected, but the value had a different type.Parsing-time exception in a template (as opposed to a runtime exception, aTemplateException
).Thrown when theTemplateValueFormat
doesn't support parsing, and parsing was invoked.This exception is thrown when a#stop
directive is encountered.Error while getting, creating or applyingTemplateValueFormat
-s (including its subclasses, likeTemplateNumberFormat
).The type of a value differs from what was expected.Thrown when aTemplateModel
can't be formatted because of the value/properties of it are outside of that theTemplateValueFormat
supports.Thrown when aTemplateDateModel
can't be formatted because its type isTemplateDateModel.UNKNOWN
.Thrown when a string can't be parsed toTemplateDateModel
, because the provided target type isTemplateDateModel.UNKNOWN
.Thrown when the content of the string that should be parsed by theTemplateValueFormat
doesn't match what the format expects.