Class SearchNode

  • All Implemented Interfaces:
    DOMRange

    public class SearchNode
    extends Object
    implements 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
    • Method Detail

      • getValue

        public String getValue​(String forcedPrefix)
      • getPrefix

        public String getPrefix()
      • matchesValue

        public boolean matchesValue​(SearchNode searchNode)
        Returns true if the given search node searchNode matches the value of this search node and false otherwise.
        Parameters:
        searchNode - the search node.
        Returns:
        true if the given search node searchNode matches the value of this search node and false otherwise.
      • getNode

        public DOMNode getNode()
      • getStart

        public int getStart()
        Description copied from interface: DOMRange
        Returns the start offset of the node.
        Specified by:
        getStart in interface DOMRange
        Returns:
        the start offset of the node.
      • getEnd

        public int getEnd()
        Description copied from interface: DOMRange
        Returns the end offset of the node.
        Specified by:
        getEnd in interface DOMRange
        Returns:
        the end offset of the node.
      • getOwnerDocument

        public DOMDocument getOwnerDocument()
        Description copied from interface: DOMRange
        Returns the owner document.
        Specified by:
        getOwnerDocument in interface DOMRange
        Returns:
        the owner document.
      • 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

        public SearchNode.ValidationStatus getValidationStatus()
        Returns the validation status of the search node.
        Returns:
        the validation status of the search node.