public abstract class Node extends Object
| Modifier and Type | Field and Description |
|---|---|
static com.vladsch.flexmark.util.visitor.AstNode<Node> |
AST_ADAPTER |
static com.vladsch.flexmark.util.sequence.BasedSequence[] |
EMPTY_SEGMENTS |
static String |
SPLICE |
| Constructor and Description |
|---|
Node() |
Node(@NotNull com.vladsch.flexmark.util.sequence.BasedSequence chars) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendChain(@NotNull Node firstNode)
Append all from child to end of chain to this node
|
void |
appendChild(Node child) |
static void |
astChars(@NotNull StringBuilder out,
@NotNull CharSequence chars,
@NotNull String name) |
void |
astExtraChars(@NotNull StringBuilder out) |
void |
astString(@NotNull StringBuilder out,
boolean withExtra) |
com.vladsch.flexmark.util.sequence.BasedSequence |
baseSubSequence(int startIndex) |
com.vladsch.flexmark.util.sequence.BasedSequence |
baseSubSequence(int startIndex,
int endIndex) |
int |
countAncestorsOfType(Class<?>... classes) |
int |
countDirectAncestorsOfType(@Nullable Class<?> skip,
Class<?>... classes) |
static void |
delimitedSegmentSpan(@NotNull StringBuilder out,
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence openingSequence,
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence closingSequence,
@NotNull String name) |
static void |
delimitedSegmentSpanChars(@NotNull StringBuilder out,
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence openingSequence,
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence closingSequence,
@NotNull String name) |
int |
endOfLine(int index) |
void |
extractChainTo(@NotNull Node node) |
void |
extractToFirstInChain(@NotNull Node node) |
@Nullable Node |
getAncestorOfType(Class<?>... classes) |
void |
getAstExtra(@NotNull StringBuilder out) |
com.vladsch.flexmark.util.sequence.BasedSequence |
getBaseSequence() |
@NotNull Node |
getBlankLineSibling() |
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence |
getChars() |
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence |
getCharsFromSegments()
Get the char sequence from segments making up the node's characters.
|
com.vladsch.flexmark.util.sequence.BasedSequence |
getChildChars() |
@NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterator<Node> |
getChildIterator() |
@Nullable Node |
getChildOfType(Class<?>... classes) |
@NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterable<Node> |
getChildren() |
@NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterable<Node> |
getDescendants() |
@NotNull Document |
getDocument() |
com.vladsch.flexmark.util.sequence.BasedSequence |
getEmptyPrefix() |
com.vladsch.flexmark.util.sequence.BasedSequence |
getEmptySuffix() |
int |
getEndLineNumber() |
int |
getEndOffset() |
int |
getEndOfLine() |
com.vladsch.flexmark.util.sequence.BasedSequence |
getExactChildChars() |
@Nullable Node |
getFirstChild() |
@Nullable Node |
getFirstChildAny(Class<?>... classes) |
@Nullable Node |
getFirstChildAnyNot(Class<?>... classes) |
@NotNull Node |
getFirstInChain() |
@Nullable Node |
getGrandParent() |
@Nullable Node |
getLastBlankLineChild()
Overridden by ListBlock and any others whose children propagate their blank line to parent
|
@Nullable Node |
getLastChild() |
@Nullable Node |
getLastChildAny(Class<?>... classes) |
@Nullable Node |
getLastChildAnyNot(Class<?>... classes) |
@NotNull Node |
getLastInChain() |
static @NotNull com.vladsch.flexmark.util.sequence.BasedSequence |
getLeadSegment(@NotNull com.vladsch.flexmark.util.sequence.BasedSequence[] segments) |
com.vladsch.flexmark.util.misc.Pair<Integer,Integer> |
getLineColumnAtEnd() |
int |
getLineNumber() |
@Nullable Node |
getNext() |
@Nullable Node |
getNextAny(Class<?>... classes) |
@Nullable Node |
getNextAnyNot(Class<?>... classes) |
@NotNull String |
getNodeName() |
int |
getNodeOfTypeIndex(Class<?>... classes) |
static int |
getNodeOfTypeIndex(@NotNull Node node,
Class<?>... classes) |
@Nullable Node |
getOldestAncestorOfTypeAfter(@NotNull Class<?> ancestor,
@NotNull Class<?> after) |
@Nullable Node |
getParent() |
@Nullable Node |
getPrevious() |
@Nullable Node |
getPreviousAny(Class<?>... classes) |
@Nullable Node |
getPreviousAnyNot(Class<?>... classes) |
@NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterator<Node> |
getReversedChildIterator() |
@NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterable<Node> |
getReversedChildren() |
@NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterable<Node> |
getReversedDescendants() |
abstract @NotNull com.vladsch.flexmark.util.sequence.BasedSequence[] |
getSegments() |
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence[] |
getSegmentsForChars()
Get the segments making up the node's characters.
|
com.vladsch.flexmark.util.sequence.Range |
getSourceRange() |
int |
getStartLineNumber() |
int |
getStartOffset() |
int |
getStartOfLine() |
int |
getTextLength() |
static @NotNull com.vladsch.flexmark.util.sequence.BasedSequence |
getTrailSegment(com.vladsch.flexmark.util.sequence.BasedSequence[] segments) |
boolean |
hasChildren() |
boolean |
hasOrMoreChildren(int childCount) |
void |
insertAfter(@NotNull Node sibling) |
void |
insertBefore(Node sibling) |
void |
insertChainAfter(@NotNull Node firstNode)
Append all from child to end of chain to this node
|
void |
insertChainBefore(@NotNull Node firstNode)
Append all from child to end of chain to this node
|
boolean |
isOrDescendantOfType(Class<?>... classes) |
com.vladsch.flexmark.util.misc.Pair<Integer,Integer> |
lineColumnAtIndex(int index) |
com.vladsch.flexmark.util.misc.Pair<Integer,Integer> |
lineColumnAtStart() |
void |
moveTrailingBlankLines() |
void |
prependChild(@NotNull Node child) |
void |
removeChildren() |
static void |
segmentSpan(@NotNull StringBuilder out,
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
@Nullable String name) |
static void |
segmentSpan(@NotNull StringBuilder out,
int startOffset,
int endOffset,
@Nullable String name) |
static void |
segmentSpanChars(@NotNull StringBuilder out,
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
@NotNull String name) |
static void |
segmentSpanChars(@NotNull StringBuilder out,
int startOffset,
int endOffset,
@Nullable String name,
@NotNull String chars) |
static void |
segmentSpanChars(@NotNull StringBuilder out,
int startOffset,
int endOffset,
@Nullable String name,
@NotNull String chars1,
@NotNull String splice,
@NotNull String chars2) |
static void |
segmentSpanCharsToVisible(@NotNull StringBuilder out,
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
@NotNull String name) |
void |
setChars(@NotNull com.vladsch.flexmark.util.sequence.BasedSequence chars) |
void |
setCharsFromContent() |
void |
setCharsFromContentOnly() |
void |
setCharsFromSegments()
Set the node's char string from segments making up the node's characters.
|
protected void |
setParent(@Nullable Node parent) |
static @NotNull com.vladsch.flexmark.util.sequence.BasedSequence |
spanningChars(com.vladsch.flexmark.util.sequence.BasedSequence... segments) |
int |
startOfLine(int index) |
void |
takeChildren(@NotNull Node node) |
@NotNull String |
toAstString(boolean withExtra) |
static @NotNull String |
toSegmentSpan(@NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
@Nullable String name) |
String |
toString() |
protected @NotNull String |
toStringAttributes() |
void |
unlink() |
public static final com.vladsch.flexmark.util.sequence.BasedSequence[] EMPTY_SEGMENTS
public static final String SPLICE
public static final com.vladsch.flexmark.util.visitor.AstNode<Node> AST_ADAPTER
public Node()
public Node(@NotNull
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence chars)
public int getStartOffset()
public int getEndOffset()
public int getTextLength()
public com.vladsch.flexmark.util.sequence.BasedSequence getBaseSequence()
public com.vladsch.flexmark.util.sequence.Range getSourceRange()
public com.vladsch.flexmark.util.sequence.BasedSequence baseSubSequence(int startIndex,
int endIndex)
public com.vladsch.flexmark.util.sequence.BasedSequence baseSubSequence(int startIndex)
public com.vladsch.flexmark.util.sequence.BasedSequence getEmptyPrefix()
public com.vladsch.flexmark.util.sequence.BasedSequence getEmptySuffix()
public int getStartOfLine()
public int getEndOfLine()
public int startOfLine(int index)
public int endOfLine(int index)
public com.vladsch.flexmark.util.misc.Pair<Integer,Integer> lineColumnAtIndex(int index)
public int countAncestorsOfType(@NotNull
Class<?>... classes)
public int countDirectAncestorsOfType(@Nullable
@Nullable Class<?> skip,
@NotNull
Class<?>... classes)
@Nullable public @Nullable Node getOldestAncestorOfTypeAfter(@NotNull @NotNull Class<?> ancestor, @NotNull @NotNull Class<?> after)
public static int getNodeOfTypeIndex(@NotNull
@NotNull Node node,
@NotNull
Class<?>... classes)
public boolean isOrDescendantOfType(@NotNull
Class<?>... classes)
public int getNodeOfTypeIndex(@NotNull
Class<?>... classes)
@Nullable public @Nullable Node getLastBlankLineChild()
@NotNull public @NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterable<Node> getChildren()
@NotNull public @NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterable<Node> getReversedChildren()
@NotNull public @NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterable<Node> getDescendants()
@NotNull public @NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterable<Node> getReversedDescendants()
@NotNull public @NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterator<Node> getChildIterator()
@NotNull public @NotNull com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterator<Node> getReversedChildIterator()
@NotNull public @NotNull com.vladsch.flexmark.util.sequence.BasedSequence getChars()
public void removeChildren()
public boolean hasChildren()
public boolean hasOrMoreChildren(int childCount)
@NotNull public @NotNull Document getDocument()
public void setChars(@NotNull
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence chars)
@Nullable public @Nullable Node getNext()
@NotNull public @NotNull Node getLastInChain()
@Nullable public @Nullable Node getPrevious()
public void extractToFirstInChain(@NotNull
@NotNull Node node)
public void extractChainTo(@NotNull
@NotNull Node node)
@NotNull public @NotNull Node getFirstInChain()
@Nullable public @Nullable Node getFirstChild()
@Nullable public @Nullable Node getFirstChildAnyNot(@NotNull Class<?>... classes)
@Nullable public @Nullable Node getLastChild()
@Nullable public @Nullable Node getParent()
@Nullable public @Nullable Node getGrandParent()
protected void setParent(@Nullable
@Nullable Node parent)
public void appendChild(Node child)
public void prependChild(@NotNull
@NotNull Node child)
public void unlink()
public void insertAfter(@NotNull
@NotNull Node sibling)
public void insertBefore(Node sibling)
public void getAstExtra(@NotNull
@NotNull StringBuilder out)
public void astExtraChars(@NotNull
@NotNull StringBuilder out)
public static void astChars(@NotNull
@NotNull StringBuilder out,
@NotNull
@NotNull CharSequence chars,
@NotNull
@NotNull String name)
@NotNull protected @NotNull String toStringAttributes()
@NotNull public abstract @NotNull com.vladsch.flexmark.util.sequence.BasedSequence[] getSegments()
@NotNull
public static @NotNull com.vladsch.flexmark.util.sequence.BasedSequence getLeadSegment(@NotNull
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence[] segments)
@NotNull public static @NotNull com.vladsch.flexmark.util.sequence.BasedSequence getTrailSegment(com.vladsch.flexmark.util.sequence.BasedSequence[] segments)
@NotNull public static @NotNull com.vladsch.flexmark.util.sequence.BasedSequence spanningChars(com.vladsch.flexmark.util.sequence.BasedSequence... segments)
public void setCharsFromContentOnly()
public void setCharsFromContent()
public static void segmentSpan(@NotNull
@NotNull StringBuilder out,
int startOffset,
int endOffset,
@Nullable
@Nullable String name)
public static void segmentSpanChars(@NotNull
@NotNull StringBuilder out,
int startOffset,
int endOffset,
@Nullable
@Nullable String name,
@NotNull
@NotNull String chars)
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)
public static void segmentSpan(@NotNull
@NotNull StringBuilder out,
@NotNull
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
@Nullable
@Nullable String name)
public static void segmentSpanChars(@NotNull
@NotNull StringBuilder out,
@NotNull
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
@NotNull
@NotNull String name)
public static void segmentSpanCharsToVisible(@NotNull
@NotNull StringBuilder out,
@NotNull
@NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence,
@NotNull
@NotNull String name)
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)
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)
public void takeChildren(@NotNull
@NotNull Node node)
@NotNull public @NotNull String getNodeName()
public void astString(@NotNull
@NotNull StringBuilder out,
boolean withExtra)
@NotNull public @NotNull String toAstString(boolean withExtra)
@NotNull public static @NotNull String toSegmentSpan(@NotNull @NotNull com.vladsch.flexmark.util.sequence.BasedSequence sequence, @Nullable @Nullable String name)
public com.vladsch.flexmark.util.sequence.BasedSequence getChildChars()
public com.vladsch.flexmark.util.sequence.BasedSequence getExactChildChars()
@NotNull public @NotNull Node getBlankLineSibling()
public void moveTrailingBlankLines()
public int getLineNumber()
public int getStartLineNumber()
public int getEndLineNumber()
@NotNull public @NotNull com.vladsch.flexmark.util.sequence.BasedSequence[] getSegmentsForChars()
Used to get segments after the some of the node's elements were modified
@NotNull public @NotNull com.vladsch.flexmark.util.sequence.BasedSequence getCharsFromSegments()
Used to get segments after the some of the node's elements were modified
public void setCharsFromSegments()
Used to get segments after the some of the node's elements were modified
public void appendChain(@NotNull
@NotNull Node firstNode)
firstNode - first child in chainpublic void insertChainAfter(@NotNull
@NotNull Node firstNode)
firstNode - first child in chainpublic void insertChainBefore(@NotNull
@NotNull Node firstNode)
firstNode - first child in chainCopyright © 2020. All rights reserved.