public abstract class SimpleXPathBasedCheck extends SonarXmlCheck
SonarXmlCheck.Secondary| Constructor and Description |
|---|
SimpleXPathBasedCheck() |
| Modifier and Type | Method and Description |
|---|---|
NodeList |
evaluate(XPathExpression expression,
Node node)
Evaluates a XPath expression on a given node from DOM.
|
List<Node> |
evaluateAsList(XPathExpression expression,
Node node)
Evaluates a XPath expression on a given node from DOM, returning it as a java List of Node, possibly empty.
|
XPathExpression |
getXPathExpression(String expression)
Compiles an XPath 1.0 expression
|
inputFile, reportIssue, reportIssue, reportIssueOnFile, ruleKey, scanFile, scanFilepublic XPathExpression getXPathExpression(String expression)
expression - The expression to be compiled in XPath, as a StringIllegalStateException - When the XPath expression can not be compiled by the XPath engine.
Could occur with invalid expression, or incompatible XPath version.@CheckForNull public NodeList evaluate(XPathExpression expression, Node node)
expression - The XPath expression to be used, preferably compiled using getXPathExpression(String)node - The node to use as starting point of the XPath expressionpublic List<Node> evaluateAsList(XPathExpression expression, Node node)
expression - The XPath expression to be used, preferably compiled using getXPathExpression(String)node - The node to use as starting point of the XPath expressionCopyright © 2009–2019 SonarSource. All rights reserved.