Here you can find the source of hasActivityChildNode(Node node)
Parameter | Description |
---|---|
node | a parameter |
public static boolean hasActivityChildNode(Node node)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.HashSet; import org.w3c.dom.Node; import org.w3c.dom.Text; public class Main { public static final Collection<String> BPEL_ACTIVITIES = new HashSet<String>() { private static final long serialVersionUID = -1626491688586809929L; {/*from w w w .j a v a 2s . c o m*/ add("invoke"); add("receive"); add("reply"); add("wait"); add("exit"); add("empty"); add("throw"); add("rethrow"); add("validate"); add("assign"); add("compensate"); add("compensatescope"); add("pick"); add("onmessage"); add("onalarm"); add("sequence"); add("while"); add("repeatuntil"); add("foreach"); add("flow"); add("scope"); } }; /** * Checks whether the node has a child node that represents a * BPEL activity. * * @param node * @return whether there is an activity child node */ public static boolean hasActivityChildNode(Node node) { boolean foundNonTextChild = false; for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) { if (!(child instanceof Text)) { if (BPEL_ACTIVITIES.contains(child.getNodeName())) { foundNonTextChild = true; } } } return foundNonTextChild; } }