Class DomXmlEnsure


  • public class DomXmlEnsure
    extends org.camunda.commons.utils.EnsureUtil
    A list of generally useful source code assertions provided as static helpers.
    Author:
    Daniel Meyer
    • Constructor Summary

      Constructors 
      Constructor Description
      DomXmlEnsure()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void ensureChildElement​(DomXmlElement parentElement, DomXmlElement childElement)
      Ensures that the element is child element of the parent element.
      static void ensureNotDocumentRootExpression​(java.lang.String expression)
      Ensures that the expression is not the root expression '/'.
      static void ensureXPathNotEmpty​(org.w3c.dom.NodeList nodeList, java.lang.String expression)
      Ensure that the nodeList is either null or empty.
      static void ensureXPathNotNull​(org.w3c.dom.Node node, java.lang.String expression)
      Ensure that the node is not null.
      • Methods inherited from class org.camunda.commons.utils.EnsureUtil

        ensureNotNull, ensureParamInstanceOf
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DomXmlEnsure

        public DomXmlEnsure()
    • Method Detail

      • ensureChildElement

        public static void ensureChildElement​(DomXmlElement parentElement,
                                              DomXmlElement childElement)
        Ensures that the element is child element of the parent element.
        Parameters:
        parentElement - the parent xml dom element
        childElement - the child element
        Throws:
        SpinXmlElementException - if the element is not child of the parent element
      • ensureNotDocumentRootExpression

        public static void ensureNotDocumentRootExpression​(java.lang.String expression)
        Ensures that the expression is not the root expression '/'.
        Parameters:
        expression - the expression to ensure to be not the root expression '/'
        Throws:
        SpinXPathException - if the expression is the root expression '/'
      • ensureXPathNotNull

        public static void ensureXPathNotNull​(org.w3c.dom.Node node,
                                              java.lang.String expression)
        Ensure that the node is not null.
        Parameters:
        node - the node to ensure to be not null
        expression - the expression was used to find the node
        Throws:
        SpinXPathException - if the node is null
      • ensureXPathNotEmpty

        public static void ensureXPathNotEmpty​(org.w3c.dom.NodeList nodeList,
                                               java.lang.String expression)
        Ensure that the nodeList is either null or empty.
        Parameters:
        nodeList - the nodeList to ensure to be either null or empty
        expression - the expression was used to fine the nodeList
        Throws:
        SpinXPathException - if the nodeList is either null or empty