-
Notifications
You must be signed in to change notification settings - Fork 267
/
NodeContext.java
47 lines (41 loc) · 1.94 KB
/
NodeContext.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.vladsch.flexmark.util.format;
import com.vladsch.flexmark.util.data.DataHolder;
import com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface NodeContext<N, C extends NodeContext<N, C>> {
/**
* Creates a child rendering context that can be used to collect rendered html text. The child context inherits
* everything but the HtmlRenderer and doNotRenderLinksNesting from the parent.
*
* @return a new rendering context with a given appendable for its output
*/
@NotNull C getSubContext();
/**
* Creates a child rendering context that can be used to collect rendered html text. The child context inherits
* everything but the HtmlRenderer and doNotRenderLinksNesting from the parent.
*
* @param options options to use for the context (only options which do not affect the context construction will be used)
* @return a new rendering context with a given appendable for its output
*/
@NotNull C getSubContext(@Nullable DataHolder options);
/**
* Creates a child rendering context that can be used to collect rendered html text. The child context inherits
* everything but the HtmlRenderer and doNotRenderLinksNesting from the parent.
*
* @param options options to use for the context (only options which do not affect the context construction will be used)
* @param builder sequence builder to user for appended text for tracking original base offsets
* @return a new rendering context with a given appendable for its output
*/
@NotNull C getSubContext(@Nullable DataHolder options, @NotNull ISequenceBuilder<?, ?> builder);
/**
* @return the current node being rendered
*/
@Nullable N getCurrentNode();
/**
* Get options for the context
*
* @return data holder
*/
@NotNull DataHolder getOptions();
}