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 TypeMethodDescriptionvoid
close()
void
defineReference
(String key, String url, String text) This method stores a definition for a reference and flushes the output as much as possible.void
flush()
String[]
getReference
(String key) The methodgetReference
provides means to retrieve a reference.void
write
(char[] cbuf, int off, int len) void
write
(int c) void
void
writeEscaped
(int c) This method writes a character to out and escapes HTML entities.void
writeReference
(String key) This method places a reference on the output.void
writeReferenceText
(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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in 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:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
- See Also:
-
getReference
The methodgetReference
provides means to retrieve a reference.- Parameters:
key
- the key- Returns:
- the value of the reference or
null
for none
-
write
- Specified by:
write
in classWriter
- Throws:
IOException
- See Also:
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
- See Also:
-
write
- Overrides:
write
in 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
-