Class RNCDefine
java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.RNCNode
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.RNCDefine
- All Implemented Interfaces:
RNCRange
-
Constructor Summary
ConstructorsConstructorDescriptionRNCDefine(int start, int end) Creates a new define node spanning the given offsets. -
Method Summary
Modifier and TypeMethodDescriptionReturns the assignment operator type used in this define.getName()Returns the define name extracted from the source text.intReturns the exclusive end offset of the define name.intReturns the inclusive start offset of the define name.getText()Returns the source text spanned by this node.voidsetAssignType(RNCAssignType assignType) Sets the assignment operator type for this define.voidsetName(int start, int end) Sets the source offsets of the define name.Methods inherited from class org.eclipse.lemminx.extensions.relaxng.grammar.rnc.RNCNode
addChild, findNodeAt, getChildren, getEnd, getOwnerDocument, getParent, getStart, hasChildren, isClosed, setClosed, setEnd, setStart
-
Constructor Details
-
RNCDefine
public RNCDefine(int start, int end) Creates a new define node spanning the given offsets.- Parameters:
start- the inclusive start offset of the entire define declaration.end- the exclusive end offset (adjusted as the define body is parsed).
-
-
Method Details
-
getNodeType
- Specified by:
getNodeTypein classRNCNode
-
setName
public void setName(int start, int end) Sets the source offsets of the define name.Called by the parser when the name identifier token is encountered.
- Parameters:
start- the inclusive start offset of the name.end- the exclusive end offset of the name.
-
getName
Returns the define name extracted from the source text.Example: for
root = element root { text }, returns"root".- Returns:
- the name string, or
nullif the name offsets have not been set.
-
getNameStart
public int getNameStart()Returns the inclusive start offset of the define name.- Returns:
- the name start offset, or
-1if not set.
-
getNameEnd
public int getNameEnd()Returns the exclusive end offset of the define name.- Returns:
- the name end offset, or
-1if not set.
-
getAssignType
Returns the assignment operator type used in this define.- Returns:
- the
RNCAssignType(ASSIGN,CHOICE, orINTERLEAVE).
-
setAssignType
Sets the assignment operator type for this define.- Parameters:
assignType- the assignment type parsed from the source.
-
getText
Description copied from class:RNCNodeReturns the source text spanned by this node.- Overrides:
getTextin classRNCNode- Returns:
- the text from
RNCNode.getStart()toRNCNode.getEnd(), ornullif this node is not attached to a document.
-