Class DomXmlEnsure

java.lang.Object
org.camunda.commons.utils.EnsureUtil
org.camunda.spin.impl.xml.dom.util.DomXmlEnsure

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

    • DomXmlEnsure

      public DomXmlEnsure()
  • Method Details

    • 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(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(Node node, 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(NodeList nodeList, 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