Class Node
java.lang.Object
com.vladsch.flexmark.util.ast.Node
- Direct Known Subclasses:
Abbreviation, AnchorLink, AttributeNode, AttributesNode, ContentNode, DelimitedNodeImpl, EmbeddedAttributeProvider.EmbeddedNodeAttributes, Emoji, EnumeratedReferenceBase, EscapedCharacter, Footnote, GfmIssue, GfmUser, GitLabInline, GitLabInlineMath, HardLineBreak, HtmlEntity, HtmlInlineBase, Ins, LinkNodeBase, Macro, MacroAttribute, MacroClose, MacroReference, RefNode, ResizableImage, SimTocOption, SimTocOptionList, SoftLineBreak, SpecExampleAst, SpecExampleHtml, SpecExampleOption, SpecExampleOptionSeparator, SpecExampleOptionsList, SpecExampleSeparator, SpecExampleSource, Strikethrough, Subscript, Superscript, TableBody, TableCaption, TableCell, TableColumnSeparator, TableHead, TableRow, TableSeparator, Text, TextBase, TypographicQuotes, TypographicSmarts, WhiteSpace, WikiNode, YamlFrontMatterNode, YamlFrontMatterValue, Zzzzzz
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @NotNull BasedSequencestatic final BasedSequence[](package private) @Nullable Nodeprivate @Nullable Node(package private) @Nullable Nodeprivate @Nullable Nodeprivate @Nullable Nodestatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendChain(@NotNull Node firstNode) Append all from child to end of chain to this nodevoidappendChild(Node child) static voidastChars(@NotNull StringBuilder out, @NotNull CharSequence chars, @NotNull String name) voidastExtraChars(@NotNull StringBuilder out) voidastString(@NotNull StringBuilder out, boolean withExtra) baseSubSequence(int startIndex) baseSubSequence(int startIndex, int endIndex) intcountAncestorsOfType(@NotNull Class<?>... classes) intcountDirectAncestorsOfType(@Nullable Class<?> skip, @NotNull Class<?>... classes) static voiddelimitedSegmentSpan(@NotNull StringBuilder out, @NotNull BasedSequence openingSequence, @NotNull BasedSequence sequence, @NotNull BasedSequence closingSequence, @NotNull String name) static voiddelimitedSegmentSpanChars(@NotNull StringBuilder out, @NotNull BasedSequence openingSequence, @NotNull BasedSequence sequence, @NotNull BasedSequence closingSequence, @NotNull String name) intendOfLine(int index) voidextractChainTo(@NotNull Node node) voidextractToFirstInChain(@NotNull Node node) @Nullable NodegetAncestorOfType(@NotNull Class<?>... classes) voidgetAstExtra(@NotNull StringBuilder out) @NotNull Node@NotNull BasedSequencegetChars()@NotNull BasedSequenceGet the char sequence from segments making up the node's characters.@NotNull ReversiblePeekingIterator<Node> @Nullable NodegetChildOfType(@NotNull Class<?>... classes) @NotNull ReversiblePeekingIterable<Node> @NotNull ReversiblePeekingIterable<Node> @NotNull Documentintintint@Nullable Node@Nullable NodegetFirstChildAny(@NotNull Class<?>... classes) @Nullable NodegetFirstChildAnyNot(@NotNull Class<?>... classes) @NotNull Node@Nullable Node@Nullable NodeOverridden by ListBlock and any others whose children propagate their blank line to parent@Nullable Node@Nullable NodegetLastChildAny(@NotNull Class<?>... classes) @Nullable NodegetLastChildAnyNot(@NotNull Class<?>... classes) @NotNull Nodestatic @NotNull BasedSequencegetLeadSegment(@NotNull BasedSequence[] segments) int@Nullable NodegetNext()@Nullable NodegetNextAny(@NotNull Class<?>... classes) @Nullable NodegetNextAnyNot(@NotNull Class<?>... classes) @NotNull Stringstatic intgetNodeOfTypeIndex(@NotNull Node node, @NotNull Class<?>... classes) intgetNodeOfTypeIndex(@NotNull Class<?>... classes) @Nullable NodegetOldestAncestorOfTypeAfter(@NotNull Class<?> ancestor, @NotNull Class<?> after) @Nullable Node@Nullable Node@Nullable NodegetPreviousAny(@NotNull Class<?>... classes) @Nullable NodegetPreviousAnyNot(@NotNull Class<?>... classes) @NotNull ReversiblePeekingIterator<Node> @NotNull ReversiblePeekingIterable<Node> @NotNull ReversiblePeekingIterable<Node> abstract @NotNull BasedSequence[]@NotNull BasedSequence[]Get the segments making up the node's characters.intintintintstatic @NotNull BasedSequencegetTrailSegment(BasedSequence[] segments) booleanbooleanhasOrMoreChildren(int childCount) voidinsertAfter(@NotNull Node sibling) voidinsertBefore(Node sibling) voidinsertChainAfter(@NotNull Node firstNode) Append all from child to end of chain to this nodevoidinsertChainBefore(@NotNull Node firstNode) Append all from child to end of chain to this nodebooleanisOrDescendantOfType(@NotNull Class<?>... classes) lineColumnAtIndex(int index) voidvoidprependChild(@NotNull Node child) voidstatic voidsegmentSpan(@NotNull StringBuilder out, int startOffset, int endOffset, @Nullable String name) static voidsegmentSpan(@NotNull StringBuilder out, @NotNull BasedSequence sequence, @Nullable String name) static voidsegmentSpanChars(@NotNull StringBuilder out, int startOffset, int endOffset, @Nullable String name, @NotNull String chars) static voidsegmentSpanChars(@NotNull StringBuilder out, int startOffset, int endOffset, @Nullable String name, @NotNull String chars1, @NotNull String splice, @NotNull String chars2) static voidsegmentSpanChars(@NotNull StringBuilder out, @NotNull BasedSequence sequence, @NotNull String name) static voidsegmentSpanCharsToVisible(@NotNull StringBuilder out, @NotNull BasedSequence sequence, @NotNull String name) voidsetChars(@NotNull BasedSequence chars) voidvoidvoidSet the node's char string from segments making up the node's characters.protected voidstatic @NotNull BasedSequencespanningChars(BasedSequence... segments) intstartOfLine(int index) voidtakeChildren(@NotNull Node node) @NotNull StringtoAstString(boolean withExtra) static @NotNull StringtoSegmentSpan(@NotNull BasedSequence sequence, @Nullable String name) toString()protected @NotNull Stringvoidunlink()
-
Field Details
-
EMPTY_SEGMENTS
-
SPLICE
- See Also:
-
AST_ADAPTER
-
parent
-
firstChild
-
lastChild
-
prev
-
next
-
chars
-
-
Constructor Details
-
Node
public Node() -
Node
-
-
Method Details
-
getStartOffset
public int getStartOffset() -
getEndOffset
public int getEndOffset() -
getTextLength
public int getTextLength() -
getBaseSequence
-
getSourceRange
-
baseSubSequence
-
baseSubSequence
-
getEmptyPrefix
-
getEmptySuffix
-
getStartOfLine
public int getStartOfLine() -
getEndOfLine
public int getEndOfLine() -
startOfLine
public int startOfLine(int index) -
endOfLine
public int endOfLine(int index) -
lineColumnAtIndex
-
lineColumnAtStart
-
getLineColumnAtEnd
-
getAncestorOfType
-
countAncestorsOfType
-
countDirectAncestorsOfType
-
getOldestAncestorOfTypeAfter
-
getChildOfType
-
getNodeOfTypeIndex
-
isOrDescendantOfType
-
getNodeOfTypeIndex
-
getLastBlankLineChild
Overridden by ListBlock and any others whose children propagate their blank line to parent- Returns:
- return a child block that can contain the parent's last blank line
-
getChildren
-
getReversedChildren
-
getDescendants
-
getReversedDescendants
-
getChildIterator
-
getReversedChildIterator
-
getChars
-
removeChildren
public void removeChildren() -
hasChildren
public boolean hasChildren() -
hasOrMoreChildren
public boolean hasOrMoreChildren(int childCount) -
getDocument
-
setChars
-
getNext
-
getLastInChain
-
getPrevious
-
extractToFirstInChain
-
extractChainTo
-
getFirstInChain
-
getPreviousAnyNot
-
getPreviousAny
-
getNextAnyNot
-
getNextAny
-
getFirstChild
-
getFirstChildAnyNot
-
getFirstChildAny
-
getLastChild
-
getLastChildAnyNot
-
getLastChildAny
-
getParent
-
getGrandParent
-
setParent
-
appendChild
-
prependChild
-
unlink
public void unlink() -
insertAfter
-
insertBefore
-
toString
-
getAstExtra
-
astExtraChars
-
astChars
public static void astChars(@NotNull @NotNull StringBuilder out, @NotNull @NotNull CharSequence chars, @NotNull @NotNull String name) -
toStringAttributes
-
getSegments
-
getLeadSegment
@NotNull public static @NotNull BasedSequence getLeadSegment(@NotNull @NotNull BasedSequence[] segments) -
getTrailSegment
-
spanningChars
-
setCharsFromContentOnly
public void setCharsFromContentOnly() -
setCharsFromContent
public void setCharsFromContent() -
segmentSpan
public static void segmentSpan(@NotNull @NotNull StringBuilder out, int startOffset, int endOffset, @Nullable @Nullable String name) -
segmentSpanChars
public static void segmentSpanChars(@NotNull @NotNull StringBuilder out, int startOffset, int endOffset, @Nullable @Nullable String name, @NotNull @NotNull String chars) -
segmentSpanChars
public static void segmentSpanChars(@NotNull @NotNull StringBuilder out, int startOffset, int endOffset, @Nullable @Nullable String name, @NotNull @NotNull String chars1, @NotNull @NotNull String splice, @NotNull @NotNull String chars2) -
segmentSpan
public static void segmentSpan(@NotNull @NotNull StringBuilder out, @NotNull @NotNull BasedSequence sequence, @Nullable @Nullable String name) -
segmentSpanChars
public static void segmentSpanChars(@NotNull @NotNull StringBuilder out, @NotNull @NotNull BasedSequence sequence, @NotNull @NotNull String name) -
segmentSpanCharsToVisible
public static void segmentSpanCharsToVisible(@NotNull @NotNull StringBuilder out, @NotNull @NotNull BasedSequence sequence, @NotNull @NotNull String name) -
delimitedSegmentSpan
public static void delimitedSegmentSpan(@NotNull @NotNull StringBuilder out, @NotNull @NotNull BasedSequence openingSequence, @NotNull @NotNull BasedSequence sequence, @NotNull @NotNull BasedSequence closingSequence, @NotNull @NotNull String name) -
delimitedSegmentSpanChars
public static void delimitedSegmentSpanChars(@NotNull @NotNull StringBuilder out, @NotNull @NotNull BasedSequence openingSequence, @NotNull @NotNull BasedSequence sequence, @NotNull @NotNull BasedSequence closingSequence, @NotNull @NotNull String name) -
takeChildren
-
getNodeName
-
astString
-
toAstString
-
toSegmentSpan
@NotNull public static @NotNull String toSegmentSpan(@NotNull @NotNull BasedSequence sequence, @Nullable @Nullable String name) -
getChildChars
-
getExactChildChars
-
getBlankLineSibling
-
moveTrailingBlankLines
public void moveTrailingBlankLines() -
getLineNumber
public int getLineNumber() -
getStartLineNumber
public int getStartLineNumber() -
getEndLineNumber
public int getEndLineNumber() -
getSegmentsForChars
Get the segments making up the node's characters.Used to get segments after the some of the node's elements were modified
- Returns:
- array of segments
-
getCharsFromSegments
Get the char sequence from segments making up the node's characters.Used to get segments after the some of the node's elements were modified
- Returns:
- concatenated string of all segments
-
setCharsFromSegments
public void setCharsFromSegments()Set the node's char string from segments making up the node's characters.Used to get segments after the some of the node's elements were modified
-
appendChain
Append all from child to end of chain to this node- Parameters:
firstNode- first child in chain
-
insertChainAfter
Append all from child to end of chain to this node- Parameters:
firstNode- first child in chain
-
insertChainBefore
Append all from child to end of chain to this node- Parameters:
firstNode- first child in chain
-