Package org.tealeaf.javamarkdown
Class MarkdownBuffer
java.lang.Object
org.tealeaf.javamarkdown.MarkdownBuffer
- All Implemented Interfaces:
 MarkdownCompiler<MarkdownBuffer>
A MarkdownCompiler that first takes all objects passed in and compiles it to an array, only rendering them when requested.
- Since:
 - 0.0.14
 - Author:
 - Thomas Kwashnak
 
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionAppends any given object to the end of the document.appendMarkdownBuffer(MarkdownBuffer markdownBuffer) Unpacks another markdown buffer and appends each item to the end of the listappendMarkdownElement(MarkdownElement element) Appends a markdown element to the end of the document.appendString(String string) Appends a string to the end of the document.toString()<T extends Writer>
TtoWriter(T writer) Attempts to render and write all objects to aWriter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tealeaf.javamarkdown.MarkdownCompiler
appendBold, appendBulletList, appendBulletList, appendBulletList, appendBulletList, appendBulletList, appendBulletList, appendCode, appendCodeBlock, appendCodeBlock, appendHeader, appendHeader, appendImage, appendImage, appendItalic, appendLink, appendLink, appendNumberedList, appendNumberedList, appendNumberedList, appendNumberedList, appendNumberedList, appendNumberedList, appendNumberedList, appendNumberedList, appendNumberedList, appendNumberedList, appendNumberedList, appendNumberedList, appendStrikethrough, appendTable, appendTable 
- 
Field Details
- 
items
 
 - 
 - 
Constructor Details
- 
MarkdownBuffer
public MarkdownBuffer() 
 - 
 - 
Method Details
- 
appendString
Appends a string to the end of the document.
- Specified by:
 appendStringin interfaceMarkdownCompiler<MarkdownBuffer>- Parameters:
 string- String to append to the end of the document- Returns:
 - An instance of the MarkdownCompiler used
 - Since:
 - 0.0.14
 
 - 
append
Appends any given object to the end of the document. Checks what type of object was passed and uses the correct method accordingly
- If the object provided extends the 
MarkdownElementclass, then this method will useMarkdownCompiler.appendMarkdownElement(MarkdownElement)to handle adding the element to the document. - Otherwise, this method will use 
MarkdownCompiler.appendString(String)and pass theObject.toString()result as the string. 
If another
MarkdownBufferobject is passed, this buffer will useappendMarkdownBuffer(MarkdownBuffer)to append its contents- Specified by:
 appendin interfaceMarkdownCompiler<MarkdownBuffer>- Parameters:
 object- Content to add to the end of the document- Returns:
 - An instance of the MarkdownCompiler used
 - Since:
 - 0.0.15
 - See Also:
 
 - If the object provided extends the 
 - 
appendMarkdownElement
Appends a markdown element to the end of the document. Adjusts and manages new lines depending on the requirements set by the Markdown Element
- Specified by:
 appendMarkdownElementin interfaceMarkdownCompiler<MarkdownBuffer>- Parameters:
 element- Markdown Element to add to the end of the document- Returns:
 - An instance of the MarkdownCompiler used
 - Since:
 - 0.0.14
 - See Also:
 
 - 
appendMarkdownBuffer
Unpacks another markdown buffer and appends each item to the end of the list- Parameters:
 markdownBuffer- MarkdownBuffer to unpack- Returns:
 - A reference to the final Markdown Buffer
 - Since:
 - 0.0.15
 
 - 
toString
 - 
toWriter
Attempts to render and write all objects to aWriter.- Type Parameters:
 T- The writer's original type, which should extend theWriterclass- Parameters:
 writer- The writer itself- Returns:
 - The writer after attempting to write the objects to the writer
 - Since:
 - 0.0.14
 
 
 -