Class RNCFileReferenceNode

java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.RNCNode
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.RNCFileReferenceNode
All Implemented Interfaces:
RNCRange
Direct Known Subclasses:
RNCExternal, RNCInclude

public abstract class RNCFileReferenceNode extends RNCNode
Base class for RNC nodes that reference an external file via a URI literal.

Shared by RNCInclude (include "file.rnc") and RNCExternal (external "file.rnc").

  • Constructor Details

    • RNCFileReferenceNode

      protected RNCFileReferenceNode(int start, int end)
      Creates a new file reference node spanning the given offsets.
      Parameters:
      start - the inclusive start offset.
      end - the exclusive end offset.
  • Method Details

    • setUri

      public void setUri(int start, int end)
      Sets the source offsets of the URI literal.
      Parameters:
      start - the inclusive start offset (including the opening quote).
      end - the exclusive end offset (after the closing quote).
    • getUri

      public String getUri()
      Returns the file reference URI with surrounding quotes stripped.

      Use case: used by document links to create clickable file references, and by the include resolver to locate the referenced grammar file.

      Returns:
      the URI string without quotes, or null if not set.
    • getUriStart

      public int getUriStart()
      Returns the inclusive start offset of the URI literal.
      Returns:
      the URI start offset, or -1 if not set.
    • getUriEnd

      public int getUriEnd()
      Returns the exclusive end offset of the URI literal.
      Returns:
      the URI end offset, or -1 if not set.