All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.pvanassen.steam.store.xpath.XPathHelper Maven / Gradle / Ivy

Go to download

A Java API to access the Steam community market through the HTTP interface. This may be against the TOS so be careful using it!

There is a newer version: 3.0.8
Show newest version
package nl.pvanassen.steam.store.xpath;

import org.slf4j.LoggerFactory;

import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;

/**
 * Get xpath expression
 * @author Paul van Assen
 *
 */
public class XPathHelper {
    private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();
    private static final XPath XPATH = XPATH_FACTORY.newXPath();
    
    private XPathHelper() {
        super();
    }
    
    /**
     * Generate xpath expression from string
     * @param xpath Xpath
     * @return Parsed expression
     */
    public static XPathExpression getXpathExpression(String xpath) {
        try {
            return XPATH.compile(xpath);
        }
        catch (XPathExpressionException e) {
            LoggerFactory.getLogger(XPathHelper.class).error("Error instantiating XPATH", e);
        }
        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy