Class XPathEvaluator


  • public class XPathEvaluator
    extends java.lang.Object
    Evaluates XPath expressions.
    Since:
    6.0.0
    Author:
    Clément Fournier
    • Constructor Summary

      Constructors 
      Constructor Description
      XPathEvaluator()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<net.sourceforge.pmd.lang.ast.Node> evaluateQuery​(net.sourceforge.pmd.lang.ast.Node compilationUnit, net.sourceforge.pmd.lang.LanguageVersion languageVersion, java.lang.String xpathVersion, java.lang.String xpathQuery, java.util.List<PropertyDescriptorSpec> properties)
      Evaluates an XPath query on the compilation unit.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XPathEvaluator

        public XPathEvaluator()
    • Method Detail

      • evaluateQuery

        public java.util.List<net.sourceforge.pmd.lang.ast.Node> evaluateQuery​(net.sourceforge.pmd.lang.ast.Node compilationUnit,
                                                                               net.sourceforge.pmd.lang.LanguageVersion languageVersion,
                                                                               java.lang.String xpathVersion,
                                                                               java.lang.String xpathQuery,
                                                                               java.util.List<PropertyDescriptorSpec> properties)
                                                                        throws XPathEvaluationException
        Evaluates an XPath query on the compilation unit. Performs no side effects.
        Parameters:
        compilationUnit - AST root
        languageVersion - language version
        xpathVersion - XPath version
        xpathQuery - XPath query
        properties - Properties of the rule
        Throws:
        XPathEvaluationException - if there was an error during the evaluation. The cause is preserved