Java XPath Create getXPathType(Class c)

Here you can find the source of getXPathType(Class c)

Description

get X Path Type

License

Open Source License

Declaration

private static QName getXPathType(Class c) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import javax.xml.xpath.XPathConstants;

import javax.xml.namespace.QName;

public class Main {
    private static QName getXPathType(Class c) {
        if (c == Node.class)
            return XPathConstants.NODE;
        if (c == NodeList.class)
            return XPathConstants.NODESET;
        if (c == String.class)
            return XPathConstants.STRING;
        if (c == Boolean.class)
            return XPathConstants.BOOLEAN;
        if (c == Double.class)
            return XPathConstants.NUMBER;

        return null;
    }//from www.  j  ava  2 s.c  om
}

Related

  1. getXPathListForNode(Node n)
  2. getXPathNoCache(String exp)
  3. getXPathNodeIndex(Node node, boolean ignoreWhitespace)
  4. getXPathNodes(XPath xpath, Object inic, String name)
  5. getXPathToContent(final Node root, final String selectedContent)
  6. getXpathVal(InputStream pInputStream, String pXPath)
  7. getXPathValue(XPath xpath, Node d, String xq, String def)
  8. newXPath()
  9. newXPath()