Here you can find the source of parseSwitcherConfigs(NodeList switcherConfigNodes)
private static Map<String, String> parseSwitcherConfigs(NodeList switcherConfigNodes)
//package com.java2s; //License from project: Apache License import org.w3c.dom.NamedNodeMap; import org.w3c.dom.NodeList; import java.util.HashMap; import java.util.Map; public class Main { private static Map<String, String> parseSwitcherConfigs(NodeList switcherConfigNodes) { Map<String, String> configs = new HashMap<>(); for (int i = 0; i < switcherConfigNodes.getLength(); ++i) { NamedNodeMap attributes = switcherConfigNodes.item(i).getAttributes(); if (attributes != null) { String[] keyValue = parseConfigAttr(attributes); configs.put(keyValue[0], keyValue[1]); }/*from w ww. j ava 2s.co m*/ } return configs; } private static String[] parseConfigAttr(NamedNodeMap attributes) { String key = attributes.getNamedItem("key").getTextContent(); String value = attributes.getNamedItem("value").getTextContent(); return new String[] { key, value }; } }