[intro]     [up]

Class MapParser

Extends Class: Parser

A parser that uses a Map instance to parse / format values. The format() is a map.get(), while the parse() will search for the first occurrence of that value on the map, returning it's associated key.

Example
var map = new Map([new Pair("name", "John Smith"), new Pair("age", 35)]);
var parser = new MapParser(map);
alert(parser.format("age")); //Result is 35
alert(parser.parse("John Smith")); //Result is "name"


Constructor Arguments
Name Type Default Description
map Map   The Map used to get the values
directParse boolean false If true, will not search the value to parse, but return the "formatted" value itself

Properties
directParse If true, will not search the value to parse, but return the "formatted" value itself
map The Map used to get the values



Properties
directParse
If true, will not search the value to parse, but return the "formatted" value itself
map
The Map used to get the values