Java XML Node Parse parsePairFirst(Node node)

Here you can find the source of parsePairFirst(Node node)

Description

parse Pair First

License

Open Source License

Declaration

public static Node parsePairFirst(Node node) 

Method Source Code

//package com.java2s;

import java.util.Objects;

import org.w3c.dom.Node;

public class Main {
    public static Node parsePairFirst(Node node) {
        Objects.requireNonNull(node);

        if (!node.getNodeName().equalsIgnoreCase("pair")) {
            throw new IllegalArgumentException("Node is not pair: " + node);
        }/*from   ww  w.  j a v a2  s . c  o m*/
        if (node.getChildNodes().getLength() != 2) {
            throw new IllegalArgumentException("Malformed pair: " + node);
        }

        return node.getFirstChild();
    }
}

Related

  1. parseIntervals(Node intervals)
  2. parseList(Node node)
  3. parseModule(Node module, PrintWriter out)
  4. parseOptionNode(Node node)
  5. parseOptionString(Node node)
  6. parseProperties(Node doc)
  7. parseProtoypes(Node module, Node iFace, PrintWriter out)
  8. parsePseudoHTML(Node e, StringBuffer html)
  9. parseSpelling(Node spelling)