Class Node

    • Field Detail

      • EMPTY_SEGMENTS

        public static final com.vladsch.flexmark.util.sequence.BasedSequence[] EMPTY_SEGMENTS
      • AST_ADAPTER

        public static final com.vladsch.flexmark.util.visitor.AstNode<Node> AST_ADAPTER
    • Constructor Detail

      • Node

        public Node()
      • Node

        public Node​(@NotNull
                    @NotNull com.vladsch.flexmark.util.sequence.BasedSequence chars)
    • Method Detail

      • getStartOffset

        public int getStartOffset()
      • getEndOffset

        public int getEndOffset()
      • getTextLength

        public int getTextLength()
      • getBaseSequence

        public com.vladsch.flexmark.util.sequence.BasedSequence getBaseSequence()
      • getSourceRange

        public com.vladsch.flexmark.util.sequence.Range getSourceRange()
      • baseSubSequence

        public com.vladsch.flexmark.util.sequence.BasedSequence baseSubSequence​(int startIndex,
                                                                                int endIndex)
      • baseSubSequence

        public com.vladsch.flexmark.util.sequence.BasedSequence baseSubSequence​(int startIndex)
      • getEmptyPrefix

        public com.vladsch.flexmark.util.sequence.BasedSequence getEmptyPrefix()
      • getEmptySuffix

        public com.vladsch.flexmark.util.sequence.BasedSequence getEmptySuffix()
      • getStartOfLine

        public int getStartOfLine()
      • getEndOfLine

        public int getEndOfLine()
      • startOfLine

        public int startOfLine​(int index)
      • endOfLine

        public int endOfLine​(int index)
      • lineColumnAtIndex

        public com.vladsch.flexmark.util.misc.Pair<Integer,​Integer> lineColumnAtIndex​(int index)
      • lineColumnAtStart

        public com.vladsch.flexmark.util.misc.Pair<Integer,​Integer> lineColumnAtStart()
      • getLineColumnAtEnd

        public com.vladsch.flexmark.util.misc.Pair<Integer,​Integer> getLineColumnAtEnd()
      • getAncestorOfType

        @Nullable
        public @Nullable Node getAncestorOfType​(@NotNull
                                                @NotNull Class<?>... classes)
      • countAncestorsOfType

        public int countAncestorsOfType​(@NotNull
                                        @NotNull Class<?>... classes)
      • countDirectAncestorsOfType

        public int countDirectAncestorsOfType​(@Nullable
                                              @Nullable Class<?> skip,
                                              @NotNull
                                              @NotNull Class<?>... classes)
      • getOldestAncestorOfTypeAfter

        @Nullable
        public @Nullable Node getOldestAncestorOfTypeAfter​(@NotNull
                                                           @NotNull Class<?> ancestor,
                                                           @NotNull
                                                           @NotNull Class<?> after)
      • getChildOfType

        @Nullable
        public @Nullable Node getChildOfType​(@NotNull
                                             @NotNull Class<?>... classes)
      • getNodeOfTypeIndex

        public static int getNodeOfTypeIndex​(@NotNull
                                             @NotNull Node node,
                                             @NotNull
                                             @NotNull Class<?>... classes)
      • isOrDescendantOfType

        public boolean isOrDescendantOfType​(@NotNull
                                            @NotNull Class<?>... classes)
      • getNodeOfTypeIndex

        public int getNodeOfTypeIndex​(@NotNull
                                      @NotNull Class<?>... classes)
      • getLastBlankLineChild

        @Nullable
        public @Nullable Node 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

        @NotNull
        public @NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterable<Node> getChildren()
      • getReversedChildren

        @NotNull
        public @NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterable<Node> getReversedChildren()
      • getDescendants

        @NotNull
        public @NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterable<Node> getDescendants()
      • getReversedDescendants

        @NotNull
        public @NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterable<Node> getReversedDescendants()
      • getChildIterator

        @NotNull
        public @NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterator<Node> getChildIterator()
      • getReversedChildIterator

        @NotNull
        public @NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterator<Node> getReversedChildIterator()
      • getChars

        @NotNull
        public @NotNull com.vladsch.flexmark.util.sequence.BasedSequence getChars()
      • removeChildren

        public void removeChildren()
      • hasChildren

        public boolean hasChildren()
      • hasOrMoreChildren

        public boolean hasOrMoreChildren​(int childCount)
      • getDocument

        @NotNull
        public @NotNull Document getDocument()
      • setChars

        public void setChars​(@NotNull
                             @NotNull com.vladsch.flexmark.util.sequence.BasedSequence chars)
      • getNext

        @Nullable
        public @Nullable Node getNext()
      • getLastInChain

        @NotNull
        public @NotNull Node getLastInChain()
      • getPrevious

        @Nullable
        public @Nullable Node getPrevious()
      • extractToFirstInChain

        public void extractToFirstInChain​(@NotNull
                                          @NotNull Node node)
      • extractChainTo

        public void extractChainTo​(@NotNull
                                   @NotNull Node node)
      • getFirstInChain

        @NotNull
        public @NotNull Node getFirstInChain()
      • getPreviousAnyNot

        @Nullable
        public @Nullable Node getPreviousAnyNot​(@NotNull
                                                @NotNull Class<?>... classes)
      • getPreviousAny

        @Nullable
        public @Nullable Node getPreviousAny​(@NotNull
                                             @NotNull Class<?>... classes)
      • getNextAnyNot

        @Nullable
        public @Nullable Node getNextAnyNot​(@NotNull
                                            @NotNull Class<?>... classes)
      • getNextAny

        @Nullable
        public @Nullable Node getNextAny​(@NotNull
                                         @NotNull Class<?>... classes)
      • getFirstChild

        @Nullable
        public @Nullable Node getFirstChild()
      • getFirstChildAnyNot

        @Nullable
        public @Nullable Node getFirstChildAnyNot​(@NotNull
                                                  @NotNull Class<?>... classes)
      • getFirstChildAny

        @Nullable
        public @Nullable Node getFirstChildAny​(@NotNull
                                               @NotNull Class<?>... classes)
      • getLastChild

        @Nullable
        public @Nullable Node getLastChild()
      • getLastChildAnyNot

        @Nullable
        public @Nullable Node getLastChildAnyNot​(@NotNull
                                                 @NotNull Class<?>... classes)
      • getLastChildAny

        @Nullable
        public @Nullable Node getLastChildAny​(@NotNull
                                              @NotNull Class<?>... classes)
      • getParent

        @Nullable
        public @Nullable Node getParent()
      • getGrandParent

        @Nullable
        public @Nullable Node getGrandParent()
      • setParent

        protected void setParent​(@Nullable
                                 @Nullable Node parent)
      • appendChild

        public void appendChild​(Node child)
      • prependChild

        public void prependChild​(@NotNull
                                 @NotNull Node child)
      • unlink

        public void unlink()
      • insertAfter

        public void insertAfter​(@NotNull
                                @NotNull Node sibling)
      • insertBefore

        public void insertBefore​(Node sibling)
      • getAstExtra

        public void getAstExtra​(@NotNull
                                @NotNull StringBuilder out)
      • astExtraChars

        public void astExtraChars​(@NotNull
                                  @NotNull StringBuilder out)
      • toStringAttributes

        @NotNull
        protected @NotNull String toStringAttributes()
      • getSegments

        @NotNull
        public abstract @NotNull com.vladsch.flexmark.util.sequence.BasedSequence[] getSegments()
      • getLeadSegment

        @NotNull
        public static @NotNull com.vladsch.flexmark.util.sequence.BasedSequence getLeadSegment​(@NotNull
                                                                                               @NotNull com.vladsch.flexmark.util.sequence.BasedSequence[] segments)
      • getTrailSegment

        @NotNull
        public static @NotNull com.vladsch.flexmark.util.sequence.BasedSequence getTrailSegment​(com.vladsch.flexmark.util.sequence.BasedSequence[] segments)
      • spanningChars

        @NotNull
        public static @NotNull com.vladsch.flexmark.util.sequence.BasedSequence spanningChars​(com.vladsch.flexmark.util.sequence.BasedSequence... segments)
      • 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 com.vladsch.flexmark.util.sequence.BasedSequence sequence,
                                       @Nullable
                                       @Nullable String name)
      • segmentSpanChars

        public static void segmentSpanChars​(@NotNull
                                            @NotNull StringBuilder out,
                                            @NotNull
                                            @NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
                                            @NotNull
                                            @NotNull String name)
      • segmentSpanCharsToVisible

        public static void segmentSpanCharsToVisible​(@NotNull
                                                     @NotNull StringBuilder out,
                                                     @NotNull
                                                     @NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
                                                     @NotNull
                                                     @NotNull String name)
      • delimitedSegmentSpan

        public static void delimitedSegmentSpan​(@NotNull
                                                @NotNull StringBuilder out,
                                                @NotNull
                                                @NotNull com.vladsch.flexmark.util.sequence.BasedSequence openingSequence,
                                                @NotNull
                                                @NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
                                                @NotNull
                                                @NotNull com.vladsch.flexmark.util.sequence.BasedSequence closingSequence,
                                                @NotNull
                                                @NotNull String name)
      • delimitedSegmentSpanChars

        public static void delimitedSegmentSpanChars​(@NotNull
                                                     @NotNull StringBuilder out,
                                                     @NotNull
                                                     @NotNull com.vladsch.flexmark.util.sequence.BasedSequence openingSequence,
                                                     @NotNull
                                                     @NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
                                                     @NotNull
                                                     @NotNull com.vladsch.flexmark.util.sequence.BasedSequence closingSequence,
                                                     @NotNull
                                                     @NotNull String name)
      • takeChildren

        public void takeChildren​(@NotNull
                                 @NotNull Node node)
      • getNodeName

        @NotNull
        public @NotNull String getNodeName()
      • astString

        public void astString​(@NotNull
                              @NotNull StringBuilder out,
                              boolean withExtra)
      • toAstString

        @NotNull
        public @NotNull String toAstString​(boolean withExtra)
      • toSegmentSpan

        @NotNull
        public static @NotNull String toSegmentSpan​(@NotNull
                                                    @NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
                                                    @Nullable
                                                    @Nullable String name)
      • getChildChars

        public com.vladsch.flexmark.util.sequence.BasedSequence getChildChars()
      • getExactChildChars

        public com.vladsch.flexmark.util.sequence.BasedSequence getExactChildChars()
      • getBlankLineSibling

        @NotNull
        public @NotNull Node getBlankLineSibling()
      • moveTrailingBlankLines

        public void moveTrailingBlankLines()
      • getLineNumber

        public int getLineNumber()
      • getStartLineNumber

        public int getStartLineNumber()
      • getEndLineNumber

        public int getEndLineNumber()
      • getSegmentsForChars

        @NotNull
        public @NotNull com.vladsch.flexmark.util.sequence.BasedSequence[] 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

        @NotNull
        public @NotNull com.vladsch.flexmark.util.sequence.BasedSequence 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

        public void appendChain​(@NotNull
                                @NotNull Node firstNode)
        Append all from child to end of chain to this node
        Parameters:
        firstNode - first child in chain
      • insertChainAfter

        public void insertChainAfter​(@NotNull
                                     @NotNull Node firstNode)
        Append all from child to end of chain to this node
        Parameters:
        firstNode - first child in chain
      • insertChainBefore

        public void insertChainBefore​(@NotNull
                                      @NotNull Node firstNode)
        Append all from child to end of chain to this node
        Parameters:
        firstNode - first child in chain