Class SearchNode
java.lang.Object
org.eclipse.lemminx.extensions.references.search.SearchNode
- All Implemented Interfaces:
DOMRange
Search node wraps a DOM node which matches a from/to path of a given
XMLReferenceExpression.
If the expression doesn't define multiple
XMLReferenceExpression.isMultiple() the search node contains the same
ranges (start / end offsets) and the same value than the DOM node.
Ex :
In this sample the DOM node will generate one search node with the following
range:
If the expression defines multiple
XMLReferenceExpression.isMultiple() the DOM node generates several
search node with proper ranges and value.
Ex :
In this sample the DOM node will generate two search nodes with the following
ranges:
- Author:
- Angelo ZERR
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionSearchNode(int start, int end, DOMNode node, String prefix, SearchNode.Direction direction) -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.lsp4j.Rangeorg.eclipse.lsp4j.RangecreateRange(boolean checkPrefix) intgetEnd()Returns the end offset of the node.getNode()Returns the owner document.intgetStart()Returns the start offset of the node.Returns the validation status of the search node.booleanbooleanisValid()Returns true if the search node is valid and false otherwise.booleanmatchesValue(SearchNode searchNode) Returns true if the given search nodesearchNodematches the value of this search node and false otherwise.toString()
-
Constructor Details
-
SearchNode
-
-
Method Details
-
getValue
-
getPrefix
-
matchesValue
Returns true if the given search nodesearchNodematches the value of this search node and false otherwise.- Parameters:
searchNode- the search node.- Returns:
- true if the given search node
searchNodematches the value of this search node and false otherwise.
-
getNode
-
getStart
public int getStart()Description copied from interface:DOMRangeReturns the start offset of the node. -
getEnd
public int getEnd()Description copied from interface:DOMRangeReturns the end offset of the node. -
getOwnerDocument
Description copied from interface:DOMRangeReturns the owner document.- Specified by:
getOwnerDocumentin interfaceDOMRange- Returns:
- the owner document.
-
getDirection
-
createRange
public org.eclipse.lsp4j.Range createRange() -
createRange
public org.eclipse.lsp4j.Range createRange(boolean checkPrefix) -
isNeedToAjdustWithPrefix
public boolean isNeedToAjdustWithPrefix() -
isValid
public boolean isValid()Returns true if the search node is valid and false otherwise. The node is valid when:- the search node is a 'to' node.
- the 'from' search node have none prefix.
- the 'from' search node have the expected prefix.
- Returns:
- true if the search node has valid prefix and false otherwise
-
getValidationStatus
Returns the validation status of the search node.- Returns:
- the validation status of the search node.
-
toString
-