Class DomXmlEnsure
- java.lang.Object
-
- org.camunda.commons.utils.EnsureUtil
-
- org.camunda.spin.impl.xml.dom.util.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.
-
-
-
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 elementchildElement
- 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 nullexpression
- 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 emptyexpression
- the expression was used to fine the nodeList- Throws:
SpinXPathException
- if the nodeList is either null or empty
-
-