Caplin Trader 5.1.0

Class: module:ct-element/parser/KeyValueParser

module:ct-element/parser/KeyValueParser()

new module:ct-element/parser/KeyValueParser()

Substitues a mapped value with a 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

parse(vValue, mAttributes)

Substitues a mapped value with a value if the a mapped value exists otherwise it returns the value itself.

Parameters:
Name Type Description
vValue Variant

the value which is expected to be mapped to a key in mAttributes.map

mAttributes Map

the object which holds a map of key-value pairs in its "map" element.

Returns:

the found key for the value or the value if the key was not found.