Top Description Fields Constructors Methods
jdk.internal.org.commonmark.node

public abstract Class Node

extends Object
Class Inheritance
Known Direct Subclasses
jdk.internal.org.commonmark.node.SoftLineBreak, jdk.internal.org.commonmark.node.StrongEmphasis, jdk.internal.org.commonmark.node.Text, jdk.internal.org.commonmark.node.Block, jdk.internal.org.commonmark.node.Code, jdk.internal.org.commonmark.node.CustomNode, jdk.internal.org.commonmark.node.Emphasis, jdk.internal.org.commonmark.node.HardLineBreak, jdk.internal.org.commonmark.node.HtmlInline, jdk.internal.org.commonmark.node.Image, jdk.internal.org.commonmark.node.Link, jdk.internal.org.commonmark.node.LinkReferenceDefinition
Imports
java.util.ArrayList, .Collections, .List

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

Modifier and TypeField and Description
private Node
private Node
private Node
private Node
private Node
private List<SourceSpan>

Constructor Summary

AccessConstructor and Description
public
Node()

Method Summary

Modifier and TypeMethod and Description
public abstract void
accept(Visitor visitor)

public void
addSourceSpan(SourceSpan
the source span to add
sourceSpan
)

Add a source span to the end of the list.

public void
public Node
public Node
public Node
public Node
public Node
public List<SourceSpan>

Returns:

the source spans of this node if included by the parser, an empty list otherwise
getSourceSpans
()

public void
insertAfter(Node sibling)

public void
insertBefore(Node sibling)

public void
protected void
setParent(Node parent)

public void
setSourceSpans(List<SourceSpan>
the new source spans to set
sourceSpans
)

Replace the current source spans with the provided list.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

protected String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

firstChildback to summary
private Node firstChild
lastChildback to summary
private Node lastChild
nextback to summary
private Node next
parentback to summary
private Node parent
prevback to summary
private Node prev
sourceSpansback to summary
private List<SourceSpan> sourceSpans

Constructor Detail

Nodeback to summary
public Node()

Method Detail

acceptback to summary
public abstract void accept(Visitor visitor)
addSourceSpanback to summary
public void addSourceSpan(SourceSpan sourceSpan)

Add a source span to the end of the list.

Parameters
sourceSpan:SourceSpan

the source span to add

Since
0.16.0
appendChildback to summary
public void appendChild(Node child)
getFirstChildback to summary
public Node getFirstChild()
getLastChildback to summary
public Node getLastChild()
getNextback to summary
public Node getNext()
getParentback to summary
public Node getParent()
getPreviousback to summary
public Node getPrevious()
getSourceSpansback to summary
public List<SourceSpan> getSourceSpans()
Returns:List<SourceSpan>

the source spans of this node if included by the parser, an empty list otherwise

Since
0.16.0
insertAfterback to summary
public void insertAfter(Node sibling)
insertBeforeback to summary
public void insertBefore(Node sibling)
prependChildback to summary
public void prependChild(Node child)
setParentback to summary
protected void setParent(Node parent)
setSourceSpansback to summary
public void setSourceSpans(List<SourceSpan> sourceSpans)

Replace the current source spans with the provided list.

Parameters
sourceSpans:List<SourceSpan>

the new source spans to set

Since
0.16.0
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
toStringAttributesback to summary
protected String toStringAttributes()