Class XmlParserUtil
java.lang.Object
com.aquima.interactions.foundation.ds.XmlParserUtil
Utility class for reading XML element in datasource objects.
- Since:
- 7.3
- Author:
- Danny Roest
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
getBoolean
(IXmlNode node, String attributeName) Returns whether the attribute attributeName of node is true or false.static boolean
getBoolean
(IXmlNode node, String attributeName, boolean defaultValue) Returns whether the attribute attributeName of node is true or false.static String
parseDocumentation
(IXmlNode node) Parses a documentation CData elementstatic IMultilingualText
parseMultilingualText
(IXmlNode rootNode, String nodeName) Parses the child nodeName of rootNode to a multilingual text.static IValue
parseValue
(IXmlNode rootNode, String nodeName) Parses the child nodeName of rootNode to an IValue.
-
Method Details
-
parseMultilingualText
Parses the child nodeName of rootNode to a multilingual text.- Parameters:
rootNode
- the node that contains the multilingual textnodeName
- 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
Returns whether the attribute attributeName of node is true or false.- Parameters:
node
- the nodeattributeName
- 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
Returns whether the attribute attributeName of node is true or false.- Parameters:
node
- the nodeattributeName
- the name of the attribute with the boolean valuedefaultValue
- 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
Parses the child nodeName of rootNode to an IValue.- Parameters:
rootNode
- the node that contains the IValuenodeName
- the name of the node representing the IValue- Returns:
- the IValue represented in nodeName or null when rootNode has no child named nodeName
-
parseDocumentation
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
-