Java Utililty Methods XML Node Value Check

List of utility methods to do XML Node Value Check

Description

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

Method

booleanisExpanded(Node node)
is Expanded
return expandedComboBoxes.containsKey(node);
booleanisFiltered(Node node)
is Filtered
short type = node.getNodeType();
String name = node.getNodeName();
if (type == 8)
    return true;
if (name.equals("SCRIPT"))
    return true;
if (name.equals("LINK"))
    return true;
...
booleanisHidden(Node node)
is Hidden
if (node instanceof com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)
    return ((com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl) node).getReadOnly();
else if (node instanceof com.sun.org.apache.xerces.internal.dom.NodeImpl)
    return ((com.sun.org.apache.xerces.internal.dom.NodeImpl) node).getReadOnly();
return false;
booleanisIgnorable(Node n)
Can this node be just ignored?
int type = n.getNodeType();
String val = n.getNodeValue();
return (type == Node.TEXT_NODE && val.trim().length() == 0) || (type == Node.COMMENT_NODE);
booleanisInclude(Node node)
is Include
if (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
    return node.getNodeName().indexOf("jsp:include") >= 0 
            || node.getNodeName().indexOf("jsp:directive.include") >= 0; 
return false;
booleanisInlineNode(@Nullable final Node aNode)
Check if the passed node is a text node.
return aNode instanceof Text || aNode instanceof EntityReference;
booleanisInsertNode(Node n)
is Insert Node
return n.getNodeName().equals("insert");
booleanisJunk(Node node)
is Junk
if (node.getNodeType() == Node.COMMENT_NODE) {
    return true;
if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
    return true;
if (node.getNodeType() == Node.TEXT_NODE) {
    Text text = (Text) node;
...
booleanisLeaf(Node node)
Check if the node is a leaf node (with no child elements).
NodeList nodeList = node.getChildNodes();
if (nodeList.getLength() == 0) {
    return true;
for (int i = 0; i < nodeList.getLength(); i++) {
    if (nodeList.item(i) instanceof Element) {
        return false;
return true;
booleanisMixed(org.w3c.dom.Node node)
is Mixed
boolean retval = false;
if (node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) {
    retval = ((org.w3c.dom.Element) node).getAttribute("mixed").equals("true");
return retval;