Class NodeHelper


  • public class NodeHelper
    extends java.lang.Object
    Helper methods related to XML Nodes
    Author:
    Michel Kraemer
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.w3c.dom.Node findDirectChild​(org.w3c.dom.Node node, java.lang.String name)
      Iterate through the direct children of the given parent node and find the child with the given name
      static java.lang.String getAttrValue​(org.w3c.dom.Node node, java.lang.String attrName)
      Gets an attribute value from a node
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NodeHelper

        public NodeHelper()
    • Method Detail

      • getAttrValue

        public static java.lang.String getAttrValue​(org.w3c.dom.Node node,
                                                    java.lang.String attrName)
        Gets an attribute value from a node
        Parameters:
        node - the node
        attrName - the name of the attribute
        Returns:
        the attribute or null if the attribute does not exist
      • findDirectChild

        public static org.w3c.dom.Node findDirectChild​(org.w3c.dom.Node node,
                                                       java.lang.String name)
        Iterate through the direct children of the given parent node and find the child with the given name
        Parameters:
        node - the parent node
        name - the child's name
        Returns:
        the child or null if there is no child with the given name