Class XmlParserUtil

java.lang.Object
com.aquima.interactions.foundation.ds.XmlParserUtil

public final class XmlParserUtil extends Object
Utility class for reading XML element in datasource objects.
Since:
7.3
Author:
Danny Roest
  • Method Details

    • parseMultilingualText

      public static IMultilingualText parseMultilingualText(IXmlNode rootNode, String nodeName)
      Parses the child nodeName of rootNode to a multilingual text.
      Parameters:
      rootNode - the node that contains the multilingual text
      nodeName - the name of the node representing the multilingual text
      Returns:
      the multilingualText represented in nodeName or null when rootNode has no child named nodeName
    • getBoolean

      public static boolean getBoolean(IXmlNode node, String attributeName)
      Returns whether the attribute attributeName of node is true or false.
      Parameters:
      node - the node
      attributeName - the name of the attribute with the boolean value
      Returns:
      true if and only if node has an attribute with attributeName and its value is parsed to true.
    • getBoolean

      public static boolean getBoolean(IXmlNode node, String attributeName, boolean defaultValue)
      Returns whether the attribute attributeName of node is true or false.
      Parameters:
      node - the node
      attributeName - the name of the attribute with the boolean value
      defaultValue - the default value if the attribute is not present
      Returns:
      true if node has an attribute with attributeName and its value is parsed to true, false if node has an attribute with attributeName and its value is not parsed to true, defaultValue if node doesn't have an attribute attributeName
    • parseValue

      public static IValue parseValue(IXmlNode rootNode, String nodeName)
      Parses the child nodeName of rootNode to an IValue.
      Parameters:
      rootNode - the node that contains the IValue
      nodeName - the name of the node representing the IValue
      Returns:
      the IValue represented in nodeName or null when rootNode has no child named nodeName
    • parseDocumentation

      public static String parseDocumentation(IXmlNode node)
      Parses a documentation CData element
      Parameters:
      node - The parent node to read the documentation from
      Returns:
      The documentation as string, or null if it is not present
    • parseExpression

      public static String parseExpression(IXmlNode node, String nodeName)
      Parses an expression CData element
      Parameters:
      node - The parent node to read the expression from
      Returns:
      The expression as string, or null if it is not present
    • parseDescription

      public static String parseDescription(IXmlNode node)
      Parses a description CData element
      Parameters:
      node - The parent node to read the description from
      Returns:
      The description as string, or null if it is not present