Class XMLUtilsParser


  • public final class XMLUtilsParser
    extends Object
    The class define utility methods to extract information to a xml with the good type.
    Since:
    1.2
    Author:
    Sandrine Perrin
    • Constructor Detail

      • XMLUtilsParser

        public XMLUtilsParser()
    • Method Detail

      • extractValueToInt

        public static Integer extractValueToInt​(Element e,
                                                String tagName,
                                                int index)
        Return the first value at a specific index corresponding to the tag name in the element.
        Parameters:
        e - root element
        tagName - tag name to extract
        index - value
        Returns:
        value of tag
      • extractFirstValueToInt

        public static Integer extractFirstValueToInt​(Element e,
                                                     String tagName)
      • extractValueToDouble

        public static Double extractValueToDouble​(Element e,
                                                  String tagName,
                                                  int index)
        Return the first value at a specific index corresponding to the tag name in the element.
        Parameters:
        e - root element
        tagName - tag name to extract
        index - value
        Returns:
        value of tag
      • extractFirstValueToDouble

        public static Double extractFirstValueToDouble​(Element e,
                                                       String tagName)
      • extractValueToString

        public static String extractValueToString​(Element e,
                                                  String tagName,
                                                  int index)
        Return the first value at a specific index corresponding to the tag name in the element.
        Parameters:
        e - root element
        tagName - tag name to extract
        index - value
        Returns:
        value of tag
      • extractFirstValueToString

        public static String extractFirstValueToString​(Element e,
                                                       String tagName)
      • extractValueToInt

        public static Integer extractValueToInt​(Document doc,
                                                String tagName,
                                                int index)
        Return the first value at a specific index corresponding to the tag name in the document.
        Parameters:
        doc - document
        tagName - tag name to extract
        index - value
        Returns:
        value of tag
      • extractFirstValueToInt

        public static Integer extractFirstValueToInt​(Document doc,
                                                     String tagName)
      • extractValueToDouble

        public static Double extractValueToDouble​(Document doc,
                                                  String tagName,
                                                  int index)
        Return the first value at a specific index corresponding to the tag name in the document.
        Parameters:
        doc - document
        tagName - tag name to extract
        index - value
        Returns:
        value of tag
      • extractFirstValueToDouble

        public static Double extractFirstValueToDouble​(Document doc,
                                                       String tagName)
      • extractValueToString

        public static String extractValueToString​(Document doc,
                                                  String tagName,
                                                  int index)
        Return the first value at a specific index corresponding to the tag name in the document.
        Parameters:
        doc - document
        tagName - tag name to extract
        index - value
        Returns:
        value of tag
      • extractFirstValueToString

        public static String extractFirstValueToString​(Document doc,
                                                       String tagName)