Changeset 2010 for trunk/autoquest-plugin-http/src/main/java/de
- Timestamp:
- 07/17/15 09:52:27 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/SOAPUtils.java
r2003 r2010 406 406 } 407 407 return matchingNodes; 408 } 409 410 /** 411 * <p> 412 * Fetches the names of all child elements of a node 413 * </p> 414 * 415 * @param parentNode node for which the child names are fetched 416 * @return names of the child nodes 417 */ 418 public static List<String> getChildNodeNames(Element parentNode) { 419 List<String> childNames = new LinkedList<>(); 420 Node parameterNode = null; 421 if (parentNode != null) { 422 NodeList parameterNodes = parentNode.getChildNodes(); 423 for (int i = 0; i < parameterNodes.getLength(); i++) { 424 parameterNode = parameterNodes.item(i); 425 if (parameterNode.getNodeType() == Node.ELEMENT_NODE) { 426 String[] parameterNodeSplit = parameterNode.getNodeName().split(":"); 427 String parameterNodeName = parameterNodeSplit[parameterNodeSplit.length - 1]; 428 childNames.add(parameterNodeName); 429 } 430 } 431 } 432 return childNames; 433 } 434 435 /** 436 * <p> 437 * Fetches all children of type {@link Element} from a parent node 438 * </p> 439 * 440 * @param parentNode node for which the child elements are fetched 441 * @return the child elements 442 */ 443 public static List<Element> getChildElements(Element parentNode) { 444 List<Element> childElements = new LinkedList<>(); 445 Node parameterNode = null; 446 if (parentNode != null) { 447 NodeList parameterNodes = parentNode.getChildNodes(); 448 for (int i = 0; i < parameterNodes.getLength(); i++) { 449 parameterNode = parameterNodes.item(i); 450 if (parameterNode.getNodeType() == Node.ELEMENT_NODE) { 451 childElements.add((Element) parameterNode); 452 } 453 } 454 } 455 return childElements; 408 456 } 409 457
Note: See TracChangeset
for help on using the changeset viewer.