Singleton
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"})

Constructor Summary

Attributes Name and Description
caplin.element.formatter.NullValueFormatter()

Method Summary

Attributes Name and Description
String format(Variant vValue, Map mAttributes)

Substitutes replacement text when the string is void (null, undefined, or the empty string).

Constructor Detail

caplin.element.formatter.NullValueFormatter()

Method Detail

String format(Variant vValue, Map mAttributes)

Substitutes replacement text when the string is void (null, undefined, or the empty string).

Attribute Options:

Option Description
nullValue the replacement text to substitute in case of a null string (defaults to an empty string)

Parameters
Variant vValue the string.
Map mAttributes the map of attributes.
Returns
the replacement string in the case of a void, otherwise the unchanged string.