Java XPath Create xPath()

Here you can find the source of xPath()

Description

x Path

License

Open Source License

Return

an XPath object that can be used by the current thread

Declaration

public static XPath xPath() 

Method Source Code

//package com.java2s;
// modify it under the terms of the GNU General Public License

import javax.xml.xpath.XPath;

import javax.xml.xpath.XPathFactory;

public class Main {
    private static ThreadLocal<XPath> XPATH_POOL = new ThreadLocal<XPath>() {
        @Override/*from   w  w w. ja v  a 2  s .c om*/
        protected XPath initialValue() {
            return XPathFactory.newInstance().newXPath();
        }
    };

    /**
     * @return an XPath object that can be used by the current thread
     * @since 1.14.1
     */
    public static XPath xPath() {
        return XPATH_POOL.get();
    }
}

Related

  1. getXPathValue(XPath xpath, Node d, String xq, String def)
  2. newXPath()
  3. newXPath()
  4. newXpathExpression(final XPath xpath, final String expression)
  5. newXPathFactory()
  6. xpath()
  7. xpath(String expression)
  8. xpath(String xml, String xpath)
  9. xPath(String xPath)