Package org.ctan.markup.markdown
Class MarkdownWriter
java.lang.Object
java.io.Writer
org.ctan.markup.markdown.MarkdownWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
This class provides a writer which allows to link in deferred defined
contents.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voiddefineReference(String key, String url, String text) This method stores a definition for a reference and flushes the output as much as possible.voidflush()String[]getReference(String key) The methodgetReferenceprovides means to retrieve a reference.voidwrite(char[] cbuf, int off, int len) voidwrite(int c) voidvoidwriteEscaped(int c) This method writes a character to out and escapes HTML entities.voidwriteReference(String key) This method places a reference on the output.voidwriteReferenceText(String key) This method places a reference text on the output.
-
Constructor Details
-
MarkdownWriter
This is the constructor forMarkdownWriter.- Parameters:
out- the target writer
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException- See Also:
-
defineReference
This method stores a definition for a reference and flushes the output as much as possible.- Parameters:
key- the keyurl- the URLtext- the text- Throws:
IOException- in case of an I/O error
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException- See Also:
-
getReference
The methodgetReferenceprovides means to retrieve a reference.- Parameters:
key- the key- Returns:
- the value of the reference or
nullfor none
-
write
- Specified by:
writein classWriter- Throws:
IOException- See Also:
-
write
- Overrides:
writein classWriter- Throws:
IOException- See Also:
-
write
- Overrides:
writein classWriter- Throws:
IOException- See Also:
-
writeEscaped
This method writes a character to out and escapes HTML entities.- Parameters:
c- the character code- Throws:
IOException- in case of an I/O error
-
writeReference
This method places a reference on the output.- Parameters:
key- the key- Throws:
IOException- in case of an I/O error
-
writeReferenceText
This method places a reference text on the output.- Parameters:
key- the key- Throws:
IOException- in case of an I/O error
-