Package org.commonmark.renderer.text
Class TextContentRenderer.RendererContext
- java.lang.Object
-
- org.commonmark.renderer.text.TextContentRenderer.RendererContext
-
- All Implemented Interfaces:
TextContentNodeRendererContext
- Enclosing class:
- TextContentRenderer
private class TextContentRenderer.RendererContext extends java.lang.Object implements TextContentNodeRendererContext
-
-
Field Summary
Fields Modifier and Type Field Description private NodeRendererMap
nodeRendererMap
private TextContentWriter
textContentWriter
-
Constructor Summary
Constructors Modifier Constructor Description private
RendererContext(TextContentWriter textContentWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextContentWriter
getWriter()
LineBreakRendering
lineBreakRendering()
Controls how line breaks should be rendered, seeLineBreakRendering
.void
render(Node node)
Render the specified node and its children using the configured renderers.boolean
stripNewlines()
-
-
-
Field Detail
-
textContentWriter
private final TextContentWriter textContentWriter
-
nodeRendererMap
private final NodeRendererMap nodeRendererMap
-
-
Constructor Detail
-
RendererContext
private RendererContext(TextContentWriter textContentWriter)
-
-
Method Detail
-
lineBreakRendering
public LineBreakRendering lineBreakRendering()
Description copied from interface:TextContentNodeRendererContext
Controls how line breaks should be rendered, seeLineBreakRendering
.- Specified by:
lineBreakRendering
in interfaceTextContentNodeRendererContext
-
stripNewlines
public boolean stripNewlines()
- Specified by:
stripNewlines
in interfaceTextContentNodeRendererContext
- Returns:
- true for stripping new lines and render text as "single line", false for keeping all line breaks.
-
getWriter
public TextContentWriter getWriter()
- Specified by:
getWriter
in interfaceTextContentNodeRendererContext
- Returns:
- the writer to use
-
render
public void render(Node node)
Description copied from interface:TextContentNodeRendererContext
Render the specified node and its children using the configured renderers. This should be used to render child nodes; be careful not to pass the node that is being rendered, that would result in an endless loop.- Specified by:
render
in interfaceTextContentNodeRendererContext
- Parameters:
node
- the node to render
-
-