public class OXPathContextNode extends Object implements Comparable<OXPathContextNode>
Modifier and Type | Field and Description |
---|---|
protected static short |
DOCUMENT_POSITION_CONTAINED_BY
Document position constants
|
protected static short |
DOCUMENT_POSITION_CONTAINS
Document position constants
|
protected static short |
DOCUMENT_POSITION_DISCONNECTED
Document position constants
|
protected static short |
DOCUMENT_POSITION_FOLLOWING
Document position constants
|
protected static short |
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
Document position constants
|
protected static short |
DOCUMENT_POSITION_PRECEDING
Document position constants
|
Constructor and Description |
---|
OXPathContextNode(DOMNode iNode,
int iParent,
int iLast)
Constructor for the class.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(OXPathContextNode other)
Standard comparator for nodes.
|
int |
compareTo(OXPathContextNodeConstructed other) |
OXPathType |
contextualize(List<DOMNode> domNodes) |
boolean |
equals(Object obj) |
OXPathType |
getByOXPath(AggregatedStep aggregatedStep)
Returns the node by calling the getByXPath in the browser's XPath API.
|
OXPathType |
getByOXPath(Step step)
Returns the node by calling the getByXPath in the browser's XPath API.
|
OXPathType |
getByXPath(String stepString)
Returns the node by calling the getByXPath in the browser's XPath API.
|
OXPathType |
getByXPath(String stepString,
boolean forward)
Returns the node by calling the getByXPath in HtmlUnit.
|
OXPathType |
getByXPath(String stepString,
boolean forward,
boolean returnsNodes)
Returns the node by calling the getByXPath in HtmlUnit.
|
com.google.common.collect.Table<DOMNode,String,List<DOMNode>> |
getByXPathBulk(String pathToAnchorNode,
Set<String> contextualAttributeNodes) |
int |
getLast()
Gets the reference to the last marker
|
DOMNode |
getNode()
Gets the object node
|
static OXPathContextNode |
getNotionalContext()
Returns a unique
OXPathContextNode object, as a placeholder for beginning OXPath expression evaluation
before a root node is retrieved via the doc(uri) function. |
int |
getParent()
Gets the reference to the parent marker
|
int |
hashCode() |
boolean |
isNotionalContext()
Determines if the implicit parameter is the unique notional context
|
String |
toString() |
protected static final short DOCUMENT_POSITION_DISCONNECTED
protected static final short DOCUMENT_POSITION_PRECEDING
protected static final short DOCUMENT_POSITION_FOLLOWING
protected static final short DOCUMENT_POSITION_CONTAINS
protected static final short DOCUMENT_POSITION_CONTAINED_BY
protected static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
public OXPathContextNode(DOMNode iNode, int iParent, int iLast)
iNode
- DomNode in browser to useiParent
- reference to parent markeriLast
- reference to current markerpublic DOMNode getNode()
public int getParent()
public int getLast()
public OXPathType getByXPath(String stepString, boolean forward) throws OXPathException
stepString
- xpath query as a Stringforward
- true
for forward navigation, false
otherwiseOXPathException
- in case of error on adding nodes to the list (return value of xpath call is not a nodelist)public OXPathType getByXPath(String stepString, boolean forward, boolean returnsNodes) throws OXPathException
stepString
- xpath query as a Stringforward
- true
for forward navigation, false
otherwisereturnsNodes
- true
if navigation returns a nodeset, false
if this is unknownOXPathException
- in case of error on adding nodes to the list (return value of xpath call is not a nodelist)public OXPathType contextualize(List<DOMNode> domNodes)
public OXPathType getByXPath(String stepString) throws OXPathException
getByXPath
methodstepString
- xpath query as a StringOXPathException
- in case of error on adding nodes to the list (return value of xpath call is not a nodelist)public OXPathType getByOXPath(Step step) throws OXPathException
step
- the step to pass to the browser's XPath APIOXPathType
OXPathException
- in case of error on adding nodes to the list (return value of xpath call is not a nodelist)public OXPathType getByOXPath(AggregatedStep aggregatedStep) throws OXPathException
aggregatedStep
- the series of steps (as a String
) to pass to the browser's XPath API as a single, consolidated
call.OXPathType
OXPathException
- in case of error on adding nodes to the list (return value of xpath call is not a nodelist)public static OXPathContextNode getNotionalContext()
OXPathContextNode
object, as a placeholder for beginning OXPath expression evaluation
before a root node is retrieved via the doc(uri) function. Also used as a null context in iterative
evaluation, so that null pointers are avoided.public boolean isNotionalContext()
true
if this object is the notional context, false
otherwisepublic int compareTo(OXPathContextNode other)
Integer.MAX_VALUE
if not a numbercompareTo
in interface Comparable<OXPathContextNode>
other
- first OXPathContextNode to comparepublic int compareTo(OXPathContextNodeConstructed other)
Copyright © 2020 OXPath Team. All rights reserved.