Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.w3c.dom.Node;

public class Main {
    /**
     * Namespace-aware equals comparison. Returns <code>true</code> if either
     * {@link Node#getLocalName} or {@link Node#getNodeName} equals <code>desiredName</code>,
     * otherwise returns <code>false</code>.
     */
    public static boolean nodeNameEquals(Node node, String desiredName) {
        assert node != null : "Node must not be null";
        assert desiredName != null : "Desired getName must not be null";
        return desiredName.equals(node.getNodeName()) || desiredName.equals(node.getLocalName());
    }
}