Package org.commonmark.renderer.text
Class TextContentWriter
- java.lang.Object
-
- org.commonmark.renderer.text.TextContentWriter
-
public class TextContentWriter extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
blockSeparator
private java.lang.Appendable
buffer
private char
lastChar
private LineBreakRendering
lineBreakRendering
private java.util.LinkedList<java.lang.Boolean>
tight
-
Constructor Summary
Constructors Constructor Description TextContentWriter(java.lang.Appendable out)
TextContentWriter(java.lang.Appendable out, LineBreakRendering lineBreakRendering)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
append(char c)
private void
append(java.lang.String s)
void
block()
void
colon()
private void
flushBlockSeparator()
If a block separator has been enqueued withblock()
but not yet written, write it now.private boolean
isTight()
void
line()
void
popTight()
Remove the last "tight" setting from the top of the stack.void
pushTight(boolean tight)
Change whether blocks are tight or loose.void
resetBlock()
void
whitespace()
void
write(char c)
void
write(java.lang.String s)
void
writeStripped(java.lang.String s)
-
-
-
Field Detail
-
buffer
private final java.lang.Appendable buffer
-
lineBreakRendering
private final LineBreakRendering lineBreakRendering
-
tight
private final java.util.LinkedList<java.lang.Boolean> tight
-
blockSeparator
private java.lang.String blockSeparator
-
lastChar
private char lastChar
-
-
Constructor Detail
-
TextContentWriter
public TextContentWriter(java.lang.Appendable out)
-
TextContentWriter
public TextContentWriter(java.lang.Appendable out, LineBreakRendering lineBreakRendering)
-
-
Method Detail
-
whitespace
public void whitespace()
-
colon
public void colon()
-
line
public void line()
-
block
public void block()
-
resetBlock
public void resetBlock()
-
writeStripped
public void writeStripped(java.lang.String s)
-
write
public void write(java.lang.String s)
-
write
public void write(char c)
-
pushTight
public void pushTight(boolean tight)
Change whether blocks are tight or loose. Loose is the default where blocks are separated by a blank line. Tight is where blocks are not separated by a blank line. Tight blocks are used in lists, if there are no blank lines within the list.Note that changing this does not affect block separators that have already been enqueued with
block()
, only future ones.
-
popTight
public void popTight()
Remove the last "tight" setting from the top of the stack.
-
isTight
private boolean isTight()
-
flushBlockSeparator
private void flushBlockSeparator()
If a block separator has been enqueued withblock()
but not yet written, write it now.
-
append
private void append(java.lang.String s)
-
append
private void append(char c)
-
-