Caplin Trader 4.8.0

Class: module:caplin/element/formatter/NullValueFormatter

module:caplin/element/formatter/NullValueFormatter

Constructor

new module:caplin/element/formatter/NullValueFormatter()

Substitutes text when the value is null, undefined, or the empty string.

NullValueFormatter is typically used in the XML Renderer Framework, but can be invoked programmatically as in the following example which evaluates to "N/A":

caplin.element.formatter.NullValueFormatter.format("", {nullValue:"N/A"})
Implements:

Methods

format(vValue, mAttributes) → {String}

Substitutes replacement text when the string is void (null, undefined, or the empty string).
Parameters:
Name Type Description
vValue Variant the string.
mAttributes Map the map of attributes.
Properties
Name Type Attributes Default Description
nullValue String <optional>
'' the replacement text to substitute in case of a null string.
Returns:
the replacement string in the case of a void, otherwise the unchanged string.
Type
String