// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.text; import java.util.HashMap; import java.util.Map; /** *
Superclasses of parsers of a map represented textually as
* {key1:value1,"anystringkey":value2,'anystringkey2':value3 ...}
.
* This parser must be extended to override the way values are parsed and constructed.
Example: To create a Double map parser:
** public static final class DoubleMapParser extends MapParser<Double> { * * @Override * protected Double parseValue(String value) { * return Double.parseDouble(value); * } * * } ** *
Map parsers are NOT multithread safe, but are cheap to construct.
* * @author bratseth * @since 5.1.15 */ public abstract class MapParser{key1:value1,key2:value2 ...}
*
* @param string the textual representation of the map
* @param map the map to which the values will be added
* @return the input map instance for convenience
*/
public Map