Package org.tealeaf.javamarkdown
Class MarkdownWriter
java.lang.Object
java.io.Writer
org.tealeaf.javamarkdown.MarkdownWriter
- All Implemented Interfaces:
 Closeable,Flushable,Appendable,AutoCloseable,MarkdownCompiler<MarkdownWriter>
A builder, or writer, that implements methods for appending markdown elements, as well as the ability to directly append markdown elements
- Since:
 - 0.0.9
 - Author:
 - Thomas Kwashnak
 
- 
Field Summary
 - 
Constructor Summary
ConstructorsConstructorDescriptionCreates a newMarkdownWriter, using a newStringWriterto handle the writing functionality.MarkdownWriter(Writer writer) Creates a new MarkdownBuilder with a presetWriter. - 
Method Summary
Modifier and TypeMethodDescriptionappendMarkdownElement(MarkdownElement markdownElement) Appends a markdown element to the end of the document.appendString(String string) Writes a string to the writervoidclose()voidflush()charGets the writer used to handle core functionalitytoString()voidwrite(char[] cbuf, int off, int len) Methods inherited from class java.io.Writer
append, append, append, nullWriter, write, write, write, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tealeaf.javamarkdown.MarkdownCompiler
append, 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 
- 
Constructor Details
- 
MarkdownWriter
public MarkdownWriter()Creates a newMarkdownWriter, using a newStringWriterto handle the writing functionality.- Since:
 - 0.0.7
 
 - 
MarkdownWriter
Creates a new MarkdownBuilder with a preset
Writer. TheWriteris used as the back-end functionality. Any appending method used will append the proper string to theWriter- Parameters:
 writer- Writer to write objects to- Since:
 - 0.0.8
 
 
 - 
 - 
Method Details
- 
write
Updates the last written character value for use in
appendMarkdownElement(MarkdownElement)- Specified by:
 writein classWriter- Throws:
 IOException- If an I/O error occurs- Since:
 - 0.0.7
 
 - 
flush
- Specified by:
 flushin interfaceFlushable- Specified by:
 flushin classWriter- Throws:
 IOException- If an I/O error occurs- Since:
 - 0.0.7
 
 - 
close
- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Specified by:
 closein classWriter- Throws:
 IOException- If an I/O error occurs- Since:
 - 0.0.7
 
 - 
appendString
Writes a string to the writer
This method allows the forcing of writing a String that would otherwise be using
Writer.append(CharSequence), which returns aWriterinstead of aMarkdownWriter.- Specified by:
 appendStringin interfaceMarkdownCompiler<MarkdownWriter>- Parameters:
 string- String to print to the writer- Returns:
 - A reference to this Writer
 - Since:
 - 0.0.9
 
 - 
appendMarkdownElement
Description copied from interface:MarkdownCompilerAppends 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<MarkdownWriter>- Parameters:
 markdownElement- Markdown Element to add to the end of the document- Returns:
 - An instance of the MarkdownCompiler used
 - Since:
 - 0.0.9
 - See Also:
 
 - 
getWriter
Gets the writer used to handle core functionality- Returns:
 - The writer used for functionality
 - Since:
 - 0.0.9
 
 - 
getLastChar
public char getLastChar() - 
toString
 
 -