Class Xml

java.lang.Object
com.yahoo.config.application.Xml

public class Xml extends Object
Utilities for XML.
Author:
hmusum
  • Constructor Details

    • Xml

      public Xml()
  • Method Details

    • getDocument

      public static Document getDocument(Reader reader)
    • getElement

      public static Element getElement(Reader reader)
      Utility method to get an XML element from a reader.
      Parameters:
      reader - the Reader to get an xml element from
    • allElemsFromPath

      public static List<Element> allElemsFromPath(com.yahoo.config.application.api.ApplicationPackage app, String pathFromAppRoot)
      Returns the root element of each xml file under pathFromAppRoot/ in the app package.
    • mergeElems

      public static List<Element> mergeElems(Element parent, String name, com.yahoo.config.application.api.ApplicationPackage app, String pathFromAppRoot)
      Will get all sub-elements under parent named "name", just like XML.getChildren(). Then look under pathFromAppRoot/ in the app package for XML files, parse them and append elements of the same name.
      Parameters:
      parent - parent XML node
      name - name of elements to merge
      app - an ApplicationPackage
      pathFromAppRoot - path from application root
      Returns:
      list of all sub-elements with given name