test_class.file: lib-common/src/test/java/com/kdgregory/pomutil/util/TestUtils.java
test_class.identifier: TestUtils
test_case.body: @Test
      public void testRemoveChildrenToMapWithNamespaces() throws Exception
      {
          Document dom = element("root",
                              element("x", "c2"),
                              element("x", "c1"),
                              element("x", "c5"),
                              element("x", "c4"),
                              element("x", "c3"))
                         .toDOM();
          Element root = dom.getDocumentElement();
  
          Map<String,Element> map = Utils.removeChildrenToMap(root);
  
          assertTrue("root no longer has children", DomUtil.getChildren(root).isEmpty());
          assertEquals("child names, in order",
                       Arrays.asList("c2", "c1", "c5", "c4", "c3"),
                       new ArrayList<String>(map.keySet()));
  
          for (String name : map.keySet())
          {
              assertEquals("mapping refers to correct element (" + name + ")",
                           name,
                           DomUtil.getLocalName(map.get(name)));
          }
      }
test_case.class_method_signature: TestUtils.testRemoveChildrenToMapWithNamespaces()
test_case.full_signature: @Test public void testRemoveChildrenToMapWithNamespaces()
test_case.identifier: testRemoveChildrenToMapWithNamespaces
test_case.invocations: toDOM element element element element element element getDocumentElement removeChildrenToMap assertTrue isEmpty getChildren assertEquals asList keySet keySet assertEquals getLocalName get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRemoveChildrenToMapWithNamespaces()
focal_class.file: lib-common/src/main/java/com/kdgregory/pomutil/util/Utils.java
focal_class.identifier: Utils
focal_class.class_method_signature: Utils.buildFileListFromStringList(List<String> sources)
focal_class.full_signature: public static List<File> buildFileListFromStringList(List<String> sources)
focal_class.identifier: buildFileListFromStringList
focal_class.modifiers: public static
focal_class.parameters: (List<String> sources)
focal_class.return: List<File>
focal_class.signature: List<File> buildFileListFromStringList(List<String> sources)
focal_class.class_method_signature: Utils.buildFileList(List<File> sources)
focal_class.full_signature: public static List<File> buildFileList(List<File> sources)
focal_class.identifier: buildFileList
focal_class.modifiers: public static
focal_class.parameters: (List<File> sources)
focal_class.return: List<File>
focal_class.signature: List<File> buildFileList(List<File> sources)
focal_class.class_method_signature: Utils.extractClassesFromJar(File jarFile)
focal_class.full_signature: public static List<String> extractClassesFromJar(File jarFile)
focal_class.identifier: extractClassesFromJar
focal_class.modifiers: public static
focal_class.parameters: (File jarFile)
focal_class.return: List<String>
focal_class.signature: List<String> extractClassesFromJar(File jarFile)
focal_class.class_method_signature: Utils.removeChildrenToMap(Element elem)
focal_class.full_signature: public static Map<String,Element> removeChildrenToMap(Element elem)
focal_class.identifier: removeChildrenToMap
focal_class.modifiers: public static
focal_class.parameters: (Element elem)
focal_class.return: Map<String,Element>
focal_class.signature: Map<String,Element> removeChildrenToMap(Element elem)
focal_class.class_method_signature: Utils.reconstruct(Element elem, String... childOrder)
focal_class.full_signature: public static Element reconstruct(Element elem, String... childOrder)
focal_class.identifier: reconstruct
focal_class.modifiers: public static
focal_class.parameters: (Element elem, String... childOrder)
focal_class.return: Element
focal_class.signature: Element reconstruct(Element elem, String... childOrder)
focal_class.class_method_signature: Utils.reconstruct(Element elem, Map<String,Element> children, String... childOrder)
focal_class.full_signature: public static Element reconstruct(Element elem, Map<String,Element> children, String... childOrder)
focal_class.identifier: reconstruct
focal_class.modifiers: public static
focal_class.parameters: (Element elem, Map<String,Element> children, String... childOrder)
focal_class.return: Element
focal_class.signature: Element reconstruct(Element elem, Map<String,Element> children, String... childOrder)
focal_method.body: public static Map<String,Element> removeChildrenToMap(Element elem)
      {
          Map<String,Element> children = new LinkedHashMap<String,Element>();
          for (Element child : DomUtil.getChildren(elem))
          {
              String localName = DomUtil.getLocalName(child);
              Element prev = children.put(localName, child);
              if (prev != null)
                  throw new IllegalStateException("duplicate child name: " + localName);
              elem.removeChild(child);
          }
          return children;
      }
focal_method.class_method_signature: Utils.removeChildrenToMap(Element elem)
focal_method.full_signature: public static Map<String,Element> removeChildrenToMap(Element elem)
focal_method.identifier: removeChildrenToMap
focal_method.invocations: getChildren getLocalName put removeChild
focal_method.modifiers: public static
focal_method.parameters: (Element elem)
focal_method.return: Map<String,Element>
focal_method.signature: Map<String,Element> removeChildrenToMap(Element elem)