Package org.commonmark.node
Class Node
java.lang.Object
org.commonmark.node.Node
- Direct Known Subclasses:
Block,Code,CustomNode,Emphasis,HardLineBreak,HtmlInline,Image,Link,SoftLineBreak,StrongEmphasis,Text
The base class of all CommonMark AST nodes (
Block and inlines).
A node can have multiple children, and a parent (except for the root node).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidvoidaddSourceSpan(SourceSpan sourceSpan) Add a source span to the end of the list.voidappendChild(Node child) getNext()voidinsertAfter(Node sibling) Inserts thesiblingnode afterthisnode.voidinsertBefore(Node sibling) Inserts thesiblingnode beforethisnode.voidprependChild(Node child) protected voidvoidsetSourceSpans(List<SourceSpan> sourceSpans) Replace the current source spans with the provided list.toString()protected Stringvoidunlink()
-
Field Details
-
parent
-
firstChild
-
lastChild
-
prev
-
next
-
sourceSpans
-
-
Constructor Details
-
Node
public Node()
-
-
Method Details
-
accept
-
getNext
-
getPrevious
-
getFirstChild
-
getLastChild
-
getParent
-
setParent
-
appendChild
-
prependChild
-
unlink
public void unlink() -
insertAfter
Inserts thesiblingnode afterthisnode. -
insertBefore
Inserts thesiblingnode beforethisnode. -
getSourceSpans
- Returns:
- the source spans of this node if included by the parser, an empty list otherwise
- Since:
- 0.16.0
-
setSourceSpans
Replace the current source spans with the provided list.- Parameters:
sourceSpans- the new source spans to set- Since:
- 0.16.0
-
addSourceSpan
Add a source span to the end of the list.- Parameters:
sourceSpan- the source span to add- Since:
- 0.16.0
-
toString
-
toStringAttributes
-