Java XPath Create getXPathFactory()

Here you can find the source of getXPathFactory()

Description

Gets the XPath factory, creating it if necessary.

License

Open Source License

Return

the XPath factory.

Declaration

public static synchronized XPathFactory getXPathFactory() 

Method Source Code

//package com.java2s;

import javax.xml.xpath.XPathFactory;

public class Main {
    private static XPathFactory xpathFactory;

    /**/*from  w w w  . j av a 2 s .c  o m*/
     * Gets the XPath factory, creating it if necessary.
     * 
     * @return the XPath factory.
     */
    public static synchronized XPathFactory getXPathFactory() {
        if (xpathFactory == null) {
            xpathFactory = XPathFactory.newInstance();
        }
        return xpathFactory;
    }
}

Related

  1. getXpathExpressionNode(Object xprContext, String xpExpression)
  2. getXpathExpressionValue(Object xprContext, String xpExpression)
  3. getXPathExprFromNode(Node node)
  4. getXPathExprFromNode(Node node)
  5. getXPathFactory()
  6. getXPathFactory()
  7. getXPathFactory()
  8. getXpathFilter(String xpath, Map namespaceMap)
  9. getXPathForElement(Node e, NamespaceContext ctx)