/** * Parses configurations formatted like * <code><pre> * <key1>;<parm1>=<value1>,<value2>;<parm2>=<value1>... * <key2>;<state> * <key3>;<state>=true * <key4>;<parm1>=<value1>;<parm1>=<value2> * </pre></code> * Rules:<ul> * <li> keys MUST NOT be contained multiple times * <li> lines with empty keys are ignored (this includes empty lines or * lines that are <code>null</code>) * <li> If parameter appear multiple time values are appended * <li> empty parameter names are ignored * <li> parameters MIST NOT start with '=' * </ul> * @param configuration The configuration * @throws IllegalArgumentException on any syntax error in the parsed * configuration */ public static Map<String,Map<String,List<String>>> parseConfig(Iterable<String> configuration) { Map<String,Map<String,List<String>>> config = new HashMap<String,Map<String,List<String>>>(); for(String line : configuration){ parseLine(config, line); } return config; } /**
/** * Parses configurations formatted like * <code><pre> * <key1>;<parm1>=<value1>,<value2>;<parm2>=<value1>... * <key2>;<state> * <key3>;<state>=true * <key4>;<parm1>=<value1>;<parm1>=<value2> * </pre></code> * Rules:<ul> * <li> keys MUST NOT be contained multiple times * <li> lines with empty keys are ignored (this includes empty lines or * lines that are <code>null</code>) * <li> If parameter appear multiple time values are appended * <li> empty parameter names are ignored * <li> parameters MIST NOT start with '=' * </ul> * @param configuration The configuration * @throws IllegalArgumentException on any syntax error in the parsed * configuration */ public static Map<String,Map<String,List<String>>> parseConfig(Iterable<String> configuration) { Map<String,Map<String,List<String>>> config = new HashMap<String,Map<String,List<String>>>(); for(String line : configuration){ parseLine(config, line); } return config; } /**
/** * Parses configurations formatted like * <code><pre> * <key1>;<parm1>=<value1>,<value2>;<parm2>=<value1>... * <key2>;<state> * <key3>;<state>=true * <key4>;<parm1>=<value1>;<parm1>=<value2> * </pre></code> * Rules:<ul> * <li> keys MUST NOT be contained multiple times * <li> lines with empty keys are ignored (this includes empty lines or * lines that are <code>null</code>) * <li> If parameter appear multiple time values are appended * <li> empty parameter names are ignored * <li> parameters MIST NOT start with '=' * </ul> * @param confIterator The Iterator over the lines of the configuration. * @throws IllegalArgumentException on any syntax error in the parsed * configuration */ public static Map<String,Map<String,List<String>>> parseConfig(Iterator<String> confIterator) { Map<String,Map<String,List<String>>> config = new HashMap<String,Map<String,List<String>>>(); while(confIterator.hasNext()){ parseLine(config, confIterator.next()); } return config; } /**
/** * Parses configurations formatted like * <code><pre> * <key1>;<parm1>=<value1>,<value2>;<parm2>=<value1>... * <key2>;<state> * <key3>;<state>=true * <key4>;<parm1>=<value1>;<parm1>=<value2> * </pre></code> * Rules:<ul> * <li> keys MUST NOT be contained multiple times * <li> lines with empty keys are ignored (this includes empty lines or * lines that are <code>null</code>) * <li> If parameter appear multiple time values are appended * <li> empty parameter names are ignored * <li> parameters MIST NOT start with '=' * </ul> * @param confIterator The Iterator over the lines of the configuration. * @throws IllegalArgumentException on any syntax error in the parsed * configuration */ public static Map<String,Map<String,List<String>>> parseConfig(Iterator<String> confIterator) { Map<String,Map<String,List<String>>> config = new HashMap<String,Map<String,List<String>>>(); while(confIterator.hasNext()){ parseLine(config, confIterator.next()); } return config; } /**