@Test public void put_to_nested_map() { Reader xmlConfig = new StringReader("<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + "<config name=\"test.foobar\">" + " <nestedmap>" + " <item key=\"bar\">" + " <inner>" + " <item key=\"bar1\">30</item>" + " <item key=\"bar2\">40</item>" + " </inner>" + " </item>" + " <item key=\"foo\">" + " <inner>" + " <item key=\"foo1\">10</item>" + " <item key=\"foo2\">20</item>" + " </inner>" + " </item>" + " </nestedmap>" + "</config>"); ConfigPayload userConfig = ConfigPayload.fromBuilder(new DomConfigPayloadBuilder(null).build(getDocument(xmlConfig))); assertPayload("{\"nestedmap\":{" + "\"bar\":{\"inner\":{\"bar1\":\"30\",\"bar2\":\"40\"}}," + "\"foo\":{\"inner\":{\"foo1\":\"10\",\"foo2\":\"20\"}}}}", userConfig); }
public ConfigPayloadBuilder build(Element configE) { parseConfigName(configE); ConfigPayloadBuilder payloadBuilder = new ConfigPayloadBuilder(configDefinition); for (Element child : XML.getChildren(configE)) { parseElement(child, payloadBuilder, null); } return payloadBuilder; }
DomConfigPayloadBuilder { public ConfigPayloadBuilder build(Element configE) { parseConfigName(configE); ConfigPayloadBuilder payloadBuilder = new ConfigPayloadBuilder(configDefinition); for (Element child : XML.getChildren(configE)) { parseElement(child, payloadBuilder, null); } return payloadBuilder; } }
DomConfigPayloadBuilder { public ConfigPayloadBuilder build(Element configE) { parseConfigName(configE); ConfigPayloadBuilder payloadBuilder = new ConfigPayloadBuilder(configDefinition); for (Element child : XML.getChildren(configE)) { parseElement(child, payloadBuilder, null); } return payloadBuilder; } DomConfigPayloadBuilder(ConfigDefinition configDefinition); }
DomConfigPayloadBuilder { public ConfigPayloadBuilder build(Element configE) { parseConfigName(configE); ConfigPayloadBuilder payloadBuilder = new ConfigPayloadBuilder(configDefinition); for (Element child : XML.getChildren(configE)) { parseElement(child, payloadBuilder, null); } return payloadBuilder; } DomConfigPayloadBuilder(ConfigDefinition configDefinition); ConfigPayloadBuilder build(Element configE); static ConfigDefinitionKey parseConfigName(Element configE); }
DomConfigPayloadBuilder { public ConfigPayloadBuilder build(Element configE) { parseConfigName(configE); ConfigPayloadBuilder payloadBuilder = new ConfigPayloadBuilder(configDefinition); for (Element child : XML.getChildren(configE)) { parseElement(child, payloadBuilder, null); } return payloadBuilder; } DomConfigPayloadBuilder(ConfigDefinition configDefinition); ConfigPayloadBuilder build(Element configE); static ConfigDefinitionKey parseConfigName(Element configE);  }