- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A stringifier is responsible for stringifying the values that are inserted into a
template. There is no limitation on the types of values that can be inserted into
a template, but they must ultimately be interwoven with the boilerplate text of
the template, which requires them to become strings. By default, all values except
null
are stringified by calling toString()
on them; null
is stringified to an empty string. However, this can be customized in multiple
ways using a StringifierRegistry
. Note that escaping (e.g. HTML) and
formatting (e.g. dates) are also considered to be forms of stringification.- Author:
- Ayco Holleman
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringifier
A stringifier that stringifiesnull
to an empty string and any other value by callingtoString()
on it. -
Method Summary
-
Field Details
-
DEFAULT
A stringifier that stringifiesnull
to an empty string and any other value by callingtoString()
on it.- See Also:
-
-
Method Details
-
stringify
Stringifies the specified value. Stringifier implementations must be able to handle null values and they must never return null. ARenderException
is thrown if either requirement is not met.- Parameters:
value
- the value to be stringified- Returns:
- a string representation of the value
-