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
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 Summary
ConstructorsModifierConstructorDescriptionprotectedRNCFileReferenceNode(int start, int end) Creates a new file reference node spanning the given offsets. -
Method Summary
Modifier and TypeMethodDescriptiongetUri()Returns the file reference URI with surrounding quotes stripped.intReturns the exclusive end offset of the URI literal.intReturns the inclusive start offset of the URI literal.voidsetUri(int start, int end) Sets the source offsets of the URI literal.Methods inherited from class org.eclipse.lemminx.extensions.relaxng.grammar.rnc.RNCNode
addChild, findNodeAt, getChildren, getEnd, getNodeType, getOwnerDocument, getParent, getStart, getText, hasChildren, isClosed, setClosed, setEnd, setStart
-
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
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
nullif not set.
-
getUriStart
public int getUriStart()Returns the inclusive start offset of the URI literal.- Returns:
- the URI start offset, or
-1if not set.
-
getUriEnd
public int getUriEnd()Returns the exclusive end offset of the URI literal.- Returns:
- the URI end offset, or
-1if not set.
-