public class DOMNodeFinderService extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DOMNodeFinderService.Score |
Modifier and Type | Method and Description |
---|---|
static XPathNodePointerRanking |
computeAllPointers(DOMNode target,
DOMNode rootNode,
String rootPath,
int maxSteps) |
static XPathNodePointerRanking |
computeAllPointersExtended(DOMNode target,
DOMNode rootNode,
String rootPath,
int maxSteps) |
static XPathNodePointer |
computeBestPointer(DOMNode target) |
static XPathNodePointerRanking |
computeRankingUsingTypesExtended(DOMNode target,
DOMNode rootNode,
String rootPath,
int maxSteps,
EnumSet<XPathNodePointer.Type> types,
Integer threshold) |
static XPathNodePointerRanking |
computeRobustPointers(DOMNode target) |
static XPathNodePointer |
getCanonicalXPath(DOMNode target)
Gets the absolute canonical XPath expression for a DOM node.
|
static XPathNodePointer |
getCanonicalXPath(DOMNode from,
DOMNode target) |
static Comparator<DOMNode> |
getComparatorBasedOnDocumentPosition() |
static Comparator<Long> |
getComparatorBasedOnStartEncoding() |
static XPathNodePointerRanking |
getXPathPointersByAnchor(DOMNode target)
Gets a
XPathNodePointerRanking (sorted set of XPathNodePointer ) for the target node, using anchor
nodes as main criteria for identification. |
static XPathNodePointerRanking |
getXPathPointersByAnchor(DOMNode target,
Integer threshold)
Same as
getXPathPointersByAnchor(DOMNode) but with a threshold that stops the process
as soon as the first expression above the threshold if found |
static XPathNodePointerRanking |
getXPathPointersByAttribute(DOMNode target)
Gets a
XPathNodePointerRanking (sorted set of XPathNodePointer ) for the target node, using
attributes as main criteria for identification. |
static XPathNodePointerRanking |
getXPathPointersByAttribute(DOMNode target,
Integer threshold)
Same as
getXPathPointersByAttribute(DOMNode) but with a threshold that stops the
process as soon as the first expression above the threshold if found |
static XPathNodePointerRanking |
getXPathPointersByPosition(DOMNode target)
Gets a
XPathNodePointerRanking (sorted set of XPathNodePointer ) for the target node, using position
(not canonical xpath) as main criteria for identification. |
static XPathNodePointerRanking |
getXPathPointersByPosition(DOMNode target,
Integer threshold)
Same as
getXPathPointersByAttribute(DOMNode) but with a threshold that stops the
process as soon as the first expression above the threshold if found |
static XPathNodePointerRanking |
getXPathPointersByTextContent(DOMNode target)
Gets a
XPathNodePointerRanking (sorted set of XPathNodePointer ) for the target element, using its
text children nodes as main criteria for identification. |
static XPathNodePointerRanking |
getXPathPointersByTextContent(DOMNode node,
Integer threshold)
As
DOMNodeFinderService#getXPathPointersByTextContent(DOMElement) but with a threshold for robusteness |
public static XPathNodePointerRanking computeRobustPointers(DOMNode target)
public static XPathNodePointer computeBestPointer(DOMNode target)
public static XPathNodePointerRanking computeAllPointers(DOMNode target, DOMNode rootNode, String rootPath, int maxSteps)
public static XPathNodePointerRanking computeAllPointersExtended(DOMNode target, DOMNode rootNode, String rootPath, int maxSteps)
public static XPathNodePointerRanking computeRankingUsingTypesExtended(DOMNode target, DOMNode rootNode, String rootPath, int maxSteps, EnumSet<XPathNodePointer.Type> types, Integer threshold)
public static XPathNodePointer getCanonicalXPath(DOMNode target)
target
- the target nodeXPathNodePointer
object representing the canonical xpath and its robustness scorepublic static XPathNodePointer getCanonicalXPath(DOMNode from, DOMNode target)
public static XPathNodePointerRanking getXPathPointersByAttribute(DOMNode target)
XPathNodePointerRanking
(sorted set of XPathNodePointer
) for the target node, using
attributes as main criteria for identification. The result set is sorted by robustness as defined by our framework.
In case of text node, it uses its parent to perform the evaluation but still addressing the text node as in:
./a[@id='xx']/text()[1]target
- the target elementXPathNodePointerRanking
for the target element, using attributes as main criteria for
identification.public static XPathNodePointerRanking getXPathPointersByAttribute(DOMNode target, Integer threshold)
getXPathPointersByAttribute(DOMNode)
but with a threshold that stops the
process as soon as the first expression above the threshold if foundtarget
- score
- public static XPathNodePointerRanking getXPathPointersByPosition(DOMNode target)
XPathNodePointerRanking
(sorted set of XPathNodePointer
) for the target node, using position
(not canonical xpath) as main criteria for identification. The result set is sorted by robustness as defined by our
framework. In case of text node, it uses its parent to perform the evaluation but still addressing the text node as
in: ./a[@id='xx']/text()[1]target
- the target elementXPathNodePointerRanking
for the target element, using position as main criteria for
identification.public static XPathNodePointerRanking getXPathPointersByPosition(DOMNode target, Integer threshold)
getXPathPointersByAttribute(DOMNode)
but with a threshold that stops the
process as soon as the first expression above the threshold if foundtarget
- the target elementthreshold
- XPathNodePointerRanking
for the target element, using position as main criteria for
identification.public static XPathNodePointerRanking getXPathPointersByTextContent(DOMNode target)
XPathNodePointerRanking
(sorted set of XPathNodePointer
) for the target element, using its
text children nodes as main criteria for identification. The result list is sorted by robustness as defined by our
frameworktarget
- the target nodeXPathNodePointerRanking
for the target element, using text clues as main criteria for
identification.public static XPathNodePointerRanking getXPathPointersByTextContent(DOMNode node, Integer threshold)
DOMNodeFinderService#getXPathPointersByTextContent(DOMElement)
but with a threshold for robustenessnode
- the target nodethreshold
- XPathNodePointerRanking
for the target element, using text clues as main criteria for
identification.public static XPathNodePointerRanking getXPathPointersByAnchor(DOMNode target)
XPathNodePointerRanking
(sorted set of XPathNodePointer
) for the target node, using anchor
nodes as main criteria for identification. The result set is sorted by robustness as defined by our framework. In
case of text node, it uses its parent to perform the evaluation but still addressing the text node as in:
./a[@id='xx']/text()[1]target
- the target elementXPathNodePointerRanking
for the target element, using position as main criteria for
identification.public static XPathNodePointerRanking getXPathPointersByAnchor(DOMNode target, Integer threshold)
getXPathPointersByAnchor(DOMNode)
but with a threshold that stops the process
as soon as the first expression above the threshold if foundtarget
- the target elementthreshold
- the threshold valueXPathNodePointerRanking
for the target element, using position as main criteria for
identification.public static Comparator<Long> getComparatorBasedOnStartEncoding()
public static Comparator<DOMNode> getComparatorBasedOnDocumentPosition()
Copyright © 2020 OXPath Team. All rights reserved.