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 NodeRendererMapnodeRendererMapprivate TextContentWritertextContentWriter
-
Constructor Summary
Constructors Modifier Constructor Description privateRendererContext(TextContentWriter textContentWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextContentWritergetWriter()LineBreakRenderinglineBreakRendering()Controls how line breaks should be rendered, seeLineBreakRendering.voidrender(Node node)Render the specified node and its children using the configured renderers.booleanstripNewlines()
-
-
-
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:TextContentNodeRendererContextControls how line breaks should be rendered, seeLineBreakRendering.- Specified by:
lineBreakRenderingin interfaceTextContentNodeRendererContext
-
stripNewlines
public boolean stripNewlines()
- Specified by:
stripNewlinesin 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:
getWriterin interfaceTextContentNodeRendererContext- Returns:
- the writer to use
-
render
public void render(Node node)
Description copied from interface:TextContentNodeRendererContextRender 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:
renderin interfaceTextContentNodeRendererContext- Parameters:
node- the node to render
-
-