Class Document
java.lang.Object
com.vladsch.flexmark.util.ast.Node
com.vladsch.flexmark.util.ast.ContentNode
com.vladsch.flexmark.util.ast.Block
com.vladsch.flexmark.util.ast.Document
- All Implemented Interfaces:
Content, DataHolder, MutableDataHolder, MutableDataSetter
-
Field Summary
FieldsFields inherited from class ContentNode
lineSegmentsFields inherited from class Node
AST_ADAPTER, EMPTY_SEGMENTS, firstChild, next, SPLICE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull DataHolderstatic @NotNull DataHolderaggregate(@Nullable DataHolder other, @Nullable DataHolder overrides) static @NotNull DataHolderaggregateActions(@NotNull DataHolder other, @NotNull DataHolder overrides) @NotNull MutableDataHolderclear()clear all options out of the data setbooleancontains(@NotNull DataKeyBase<?> key) @NotNull Map<? extends DataKeyBase<?>, Object> getAll()@NotNull Collection<? extends DataKeyBase<?>> getKeys()intintgetLineNumber(int offset) Get line number at offset@Nullable ObjectgetOrCompute(@NotNull DataKeyBase<?> key, @NotNull DataValueFactory<?> factory) Get key if it exists or compute using supplier@NotNull BasedSequence[]static MutableDataSetmerge(DataHolder... dataHolders) @NotNull MutableDataSetremove(@NotNull DataKeyBase<?> key) Remove the stored value for the key, used to force to default or to force recompute<T> @NotNull MutableDataHolderStore the given value for the key<T> @NotNull MutableDataHolderset(@NotNull NullableDataKey<T> key, T value) Store the given value for the key@NotNull MutableDataSetsetAll(@NotNull DataHolder other) Copy all values from one data holder to this data holder@NotNull MutableDataSetsetFrom(@NotNull MutableDataSetter dataSetter) Store the given value for the key@NotNull MutableDataHoldersetIn(@NotNull MutableDataHolder dataHolder) Set options in given mutable data holder@NotNull MutableDataSet@NotNull DataSet@NotNull MutableDataSetMethods inherited from class ContentNode
getContentChars, getContentChars, getContentLines, getContentLines, getLineChars, getSpanningChars, setContent, setContent, setContent, setContentLine, setContentLinesMethods inherited from class Node
appendChain, appendChild, astChars, astExtraChars, astString, baseSubSequence, baseSubSequence, countAncestorsOfType, countDirectAncestorsOfType, delimitedSegmentSpan, delimitedSegmentSpanChars, endOfLine, extractChainTo, extractToFirstInChain, getAncestorOfType, getAstExtra, getBaseSequence, getBlankLineSibling, getChars, getCharsFromSegments, getChildChars, getChildIterator, getChildOfType, getChildren, getDescendants, getDocument, getEmptyPrefix, getEmptySuffix, getEndLineNumber, getEndOffset, getEndOfLine, getExactChildChars, getFirstChild, getFirstChildAny, getFirstChildAnyNot, getFirstInChain, getGrandParent, getLastBlankLineChild, getLastChild, getLastChildAny, getLastChildAnyNot, getLastInChain, getLeadSegment, getLineColumnAtEnd, getLineNumber, getNext, getNextAny, getNextAnyNot, getNodeName, getNodeOfTypeIndex, getNodeOfTypeIndex, getOldestAncestorOfTypeAfter, getPrevious, getPreviousAny, getPreviousAnyNot, getReversedChildIterator, getReversedChildren, getReversedDescendants, getSegmentsForChars, getSourceRange, getStartLineNumber, getStartOffset, getStartOfLine, getTextLength, getTrailSegment, hasChildren, hasOrMoreChildren, insertAfter, insertBefore, insertChainAfter, insertChainBefore, isOrDescendantOfType, lineColumnAtIndex, lineColumnAtStart, moveTrailingBlankLines, prependChild, removeChildren, segmentSpan, segmentSpan, segmentSpanChars, segmentSpanChars, segmentSpanChars, segmentSpanCharsToVisible, setChars, setCharsFromContent, setCharsFromContentOnly, setCharsFromSegments, spanningChars, startOfLine, takeChildren, toAstString, toSegmentSpan, toString, toStringAttributes, unlinkMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface MutableDataHolder
get
-
Field Details
-
NULL
-
dataSet
-
-
Constructor Details
-
Document
-
-
Method Details
-
getSegments
- Specified by:
getSegmentsin classNode
-
clear
Description copied from interface:MutableDataHolderclear all options out of the data set- Specified by:
clearin interfaceMutableDataHolder- Returns:
- mutable data holder for chained calls
-
set
@NotNull public <T> @NotNull MutableDataHolder set(@NotNull @NotNull DataKey<T> key, @NotNull T value) Description copied from interface:MutableDataHolderStore the given value for the key- Specified by:
setin interfaceMutableDataHolder- Type Parameters:
T- data type of the data referred by the key- Parameters:
key- data keyvalue- value to store- Returns:
- mutable data holder for chained calls
-
set
@NotNull public <T> @NotNull MutableDataHolder set(@NotNull @NotNull NullableDataKey<T> key, @Nullable T value) Description copied from interface:MutableDataHolderStore the given value for the key- Specified by:
setin interfaceMutableDataHolder- Type Parameters:
T- data type of the data referred by the key- Parameters:
key- data keyvalue- value to store- Returns:
- mutable data holder for chained calls
-
setFrom
Description copied from interface:MutableDataHolderStore the given value for the key- Specified by:
setFromin interfaceMutableDataHolder- Parameters:
dataSetter- data setter which will set values- Returns:
- mutable data holder for chained calls
-
setAll
Description copied from interface:MutableDataHolderCopy all values from one data holder to this data holder- Specified by:
setAllin interfaceMutableDataHolder- Parameters:
other- data holder from which to copy all values- Returns:
- mutable data holder for chained calls
-
merge
-
setIn
Description copied from interface:MutableDataHolderSet options in given mutable data holder- Specified by:
setInin interfaceDataHolder- Specified by:
setInin interfaceMutableDataHolder- Specified by:
setInin interfaceMutableDataSetter- Parameters:
dataHolder- data holder where to copy options from this data holder- Returns:
- dataHolder
-
remove
Description copied from interface:MutableDataHolderRemove the stored value for the key, used to force to default or to force recompute- Specified by:
removein interfaceMutableDataHolder- Parameters:
key- data key to remove- Returns:
- mutable data holder for chained calls
-
getOrCompute
@Nullable public @Nullable Object getOrCompute(@NotNull @NotNull DataKeyBase<?> key, @NotNull @NotNull DataValueFactory<?> factory) Description copied from interface:DataHolderGet key if it exists or compute using supplierMethod used by DataKey classes to access data.
NOTE: MutableDataHolders will compute an absent key and add it to its dataSet. DataHolders will return computed value but not change contained dataSet because they are immutable. So value will be computed every time it is requested.
- Specified by:
getOrComputein interfaceDataHolder- Specified by:
getOrComputein interfaceMutableDataHolder- Parameters:
key- data keyfactory- factory taking this data holder and computing/providing default value- Returns:
- object value for the key
-
toMutable
- Specified by:
toMutablein interfaceDataHolder
-
toImmutable
- Specified by:
toImmutablein interfaceDataHolder
-
toDataSet
- Specified by:
toDataSetin interfaceDataHolder
-
aggregateActions
@NotNull public static @NotNull DataHolder aggregateActions(@NotNull @NotNull DataHolder other, @NotNull @NotNull DataHolder overrides) -
aggregate
-
aggregate
@NotNull public static @NotNull DataHolder aggregate(@Nullable @Nullable DataHolder other, @Nullable @Nullable DataHolder overrides) -
getAll
- Specified by:
getAllin interfaceDataHolder
-
getKeys
- Specified by:
getKeysin interfaceDataHolder
-
contains
- Specified by:
containsin interfaceDataHolder
-
getLineCount
public int getLineCount()- Specified by:
getLineCountin interfaceContent- Overrides:
getLineCountin classContentNode
-
getLineNumber
public int getLineNumber(int offset) Get line number at offsetNext line starts after the EOL sequence. offsets between \r and \n are considered part of the same line as offset before \r.
- Parameters:
offset- offset in document text- Returns:
- line number at offset
-