Singleton
caplin.element.parser

BracketsParser

Implements caplin.element.Parser.
Parses an amount with brackets and converts it to a negative number.

BracketsParser is typically used in the XML Renderer Framework, but can be invoked programmatically as in the following example which evaluates to "-123":

caplin.element.parser.BracketsParser.parse("(123)", {})

See caplin.element.formatter.BracketsFormatter for the complementary formatter.

Constructor Summary

Attributes Name and Description
caplin.element.parser.BracketsParser()

Method Summary

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

Converts amounts with brackets and converts it to a negative number.

Constructor Detail

caplin.element.parser.BracketsParser()

Method Detail

String parse(Variant vValue, Map mAttributes)

Converts amounts with brackets and converts it to a negative number.

Parameters
Variant vValue the amount.
Map mAttributes (unused)
Returns
the amount, with any brackets removed and converted to a negative number.