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 void
void
addSourceSpan
(SourceSpan sourceSpan) Add a source span to the end of the list.void
appendChild
(Node child) getNext()
void
insertAfter
(Node sibling) Inserts thesibling
node afterthis
node.void
insertBefore
(Node sibling) Inserts thesibling
node beforethis
node.void
prependChild
(Node child) protected void
void
setSourceSpans
(List<SourceSpan> sourceSpans) Replace the current source spans with the provided list.toString()
protected String
void
unlink()
-
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 thesibling
node afterthis
node. -
insertBefore
Inserts thesibling
node beforethis
node. -
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
-