Class XmlHelper


  • public final class XmlHelper
    extends Object
    Static methods for helping dom building
    Author:
    bratseth
    • Method Detail

      • nullIfEmpty

        public static String nullIfEmpty​(String attribute)
      • getIdString

        public static String getIdString​(Element element)
        For searchers inside search chains, the id may be both a reference and an id at once, or just a reference. In other cases, it is clear which one it is from context, so I think the difference is not worth bothering users with, unless they are XML purists in which case they will have the option of writing this correctly. - Jon
      • getId

        public static com.yahoo.component.ComponentId getId​(Element element)
      • getIdRef

        public static com.yahoo.component.ComponentSpecification getIdRef​(Element element)
      • spaceSeparatedSymbols

        public static List<String> spaceSeparatedSymbols​(String field)
      • isReference

        public static boolean isReference​(Element element)
      • getDocumentBuilder

        public static DocumentBuilder getDocumentBuilder()
        Creates a new XML document builder.
        Returns:
        A new DocumentBuilder instance, or null if we fail to get one.