Caplin Trader 4.7.1

Class: module:caplin/element/formatter/KeyValueFormatter

module:caplin/element/formatter/KeyValueFormatter

Constructor

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

Substitues a value with a mapped value if the a mapped value exists otherwise it returns the value itself. The mAttributes argument should have the map holding the mappings in it's map key.
Implements:

Methods

format(vValue, mAttributes)

Substitues a value with a mapped value if the a mapped value exists otherwise it returns the value itself.
Parameters:
Name Type Description
vValue Variant the key which is expected to have mapping to a value in mAttributes.map.
mAttributes Map the object which holds a map of key-value pairs in its "map" element.
Returns:
the found value for the passed key or the the key if the value was not found.