List of usage examples for org.apache.commons.configuration SubnodeConfiguration getRoot
public Node getRoot()
From source file:com.aol.advertising.qiao.util.XmlConfigUtil.java
public static Map<String, Object> parseSingleNodeAttributes(HierarchicalConfiguration config, String key) { Map<String, Object> result = null; // get a subnode configuration for the node specified by the given key SubnodeConfiguration c = config.configurationAt(key); if (c != null) { Node root = c.getRoot(); result = new HashMap<String, Object>(root.getAttributeCount()); List<?> attrs = root.getAttributes(); for (Object attr : attrs) { ConfigurationNode nd = (ConfigurationNode) attr; result.put(nd.getName(), nd.getValue()); }//from ww w . j a v a 2s .co m } return result; }