Class XMLConfUtils


  • public class XMLConfUtils
    extends XMLUtils
    Common XML Tasks.
    Author:
    Damian Minkov, Emil Ivov
    • Constructor Detail

      • XMLConfUtils

        public XMLConfUtils()
    • Method Detail

      • getChildElementByChain

        public static Element getChildElementByChain​(Element parent,
                                                     String[] chain)
        Returns the element which is at the end of the specified String chain. <great...grandparent>...<grandparent>.<parent>.>child<
        Parameters:
        parent - the xml element that is the parent of the root of this chain.
        chain - a String array containing the names of all the child's parent nodes.
        Returns:
        the node represented by the specified chain
      • createLastPathComponent

        public static Element createLastPathComponent​(Document doc,
                                                      String[] path,
                                                      int pathLength)
        Creates (only if necessary) and returns the element which is at the end of the specified path.
        Parameters:
        doc - the target document where the specified path should be created
        path - an array of String elements which represents the path to be created. Each element of path up to and including the index pathLength - 1 must be valid XML (element) names
        pathLength - the length of the specified path
        Returns:
        the component at the end of the newly created path.