Java Utililty Methods XML Element Check

List of utility methods to do XML Element Check

Description

The list of methods to do XML Element Check are organized into topic(s).

Method

booleanisExtension(Element element)
is Extension
String name = element.getAttribute("name");
return "extension".equals(name);
booleanisGateway(Element element)
is Gateway
String elementLocalName = element.getLocalName();
return (GATEWAY_RECEIVER_ELEMENT_NAME.equals(elementLocalName)
        || GATEWAY_SENDER_ELEMENT_NAME.equals(elementLocalName));
booleanisHTMLElement(Element elem)
is HTML Element
return elem instanceof HTMLElement;
booleanisInfoNode(Element e)
is this Node is information node?
for (String s : INFO_NODE) {
    if (e.getTagName().equals(s)) {
        return true;
return false;
booleanisLeaf(Element element)
is Leaf
return getChildren(element).size() == 0;
booleanisLinkNode(Element e)
is Link Node
if (e.getTagName().equals(LINK_NODE)) {
    return true;
return false;
booleanisLocalName(Element element, String name)
is Local Name
return element.getLocalName().equals(name);
booleanisMuleNamespace(Element element)
is Mule Namespace
String ns = element.getNamespaceURI();
return ns != null && ns.startsWith(MULE_NAMESPACE_PREFIX);
booleanisNil(Element aElement)
Returns true if the element is null or if it has xsi:nil attribute value of "true".
if (aElement != null) {
    return "true".equals(aElement.getAttributeNS(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "nil")); 
} else {
    return true;
booleanisNil(Element element)
Tests if an element is nil.
String nil = element.getAttributeNS(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "nil");
return "true".equals(nil) || "1".equals(nil);