panda.doc.markdown.Decorator Maven / Gradle / Ivy
package panda.doc.markdown;
/**
* Decorator interface.
*/
public interface Decorator {
/**
* Called when a paragraph is opened.
*
* Default implementation is:
*
*
*
* out.append("<p>");
*
*
* @param out The StringBuilder to write to.
*/
public void openParagraph(final StringBuilder out);
/**
* Called when a paragraph is closed.
*
* Default implementation is:
*
*
*
* out.append("</p>\n");
*
*
* @param out The StringBuilder to write to.
*/
public void closeParagraph(final StringBuilder out);
/**
* Called when a blockquote is opened. Default implementation is:
*
*
* out.append("<blockquote>");
*
*
* @param out The StringBuilder to write to.
*/
public void openBlockquote(final StringBuilder out);
/**
* Called when a blockquote is closed.
*
* Default implementation is:
*
*
*
* out.append("</blockquote>\n");
*
*
* @param out The StringBuilder to write to.
*/
public void closeBlockquote(final StringBuilder out);
/**
* Called when a code block is opened.
*
* Default implementation is:
*
*
*
* out.append("<pre><code>");
*
*
* @param out The StringBuilder to write to.
*/
public void openCodeBlock(final StringBuilder out);
/**
* Called when a code block is closed.
*
* Default implementation is:
*
*
*
* out.append("</code></pre>\n");
*
*
* @param out The StringBuilder to write to.
*/
public void closeCodeBlock(final StringBuilder out);
/**
* Called when a code span is opened.
*
* Default implementation is:
*
*
*
* out.append("<code>");
*
*
* @param out The StringBuilder to write to.
*/
public void openCodeSpan(final StringBuilder out);
/**
* Called when a code span is closed.
*
* Default implementation is:
*
*
*
* out.append("</code>");
*
*
* @param out The StringBuilder to write to.
*/
public void closeCodeSpan(final StringBuilder out);
/**
* Called when a headline is opened.
*
* Note: Don't close the HTML tag!
*
*
* Default implementation is:
*
*
*
* out.append("<h");
* out.append(level);
*
*
* @param out The StringBuilder to write to.
* @param level The level
*/
public void openHeadline(final StringBuilder out, int level);
/**
* Called when a headline is closed.
*
* Default implementation is:
*
*
*
* out.append("</h");
* out.append(level);
* out.append(">\n");
*
*
* @param out The StringBuilder to write to.
* @param level The level.
*/
public void closeHeadline(final StringBuilder out, int level);
/**
* Called when a strong span is opened.
*
* Default implementation is:
*
*
*
* out.append("<strong>");
*
*
* @param out The StringBuilder to write to.
*/
public void openStrong(final StringBuilder out);
/**
* Called when a strong span is closed.
*
* Default implementation is:
*
*
*
* out.append("</strong>");
*
*
* @param out The StringBuilder to write to.
*/
public void closeStrong(final StringBuilder out);
/**
* Called when a strike span is opened.
*
* Default implementation is:
*
*
*
* out.append("<s>");
*
*
* @param out The StringBuilder to write to.
*/
public void openStrike(final StringBuilder out);
/**
* Called when a strike span is closed.
*
* Default implementation is:
*
*
*
* out.append("</s>");
*
*
* @param out The StringBuilder to write to.
*/
public void closeStrike(final StringBuilder out);
/**
* Called when an emphasis span is opened.
*
* Default implementation is:
*
*
*
* out.append("<em>");
*
*
* @param out The StringBuilder to write to.
*/
public void openEmphasis(final StringBuilder out);
/**
* Called when an emphasis span is closed.
*
* Default implementation is:
*
*
*
* out.append("</em>");
*
*
* @param out The StringBuilder to write to.
*/
public void closeEmphasis(final StringBuilder out);
/**
* Called when a superscript span is opened.
*
* Default implementation is:
*
*
*
* out.append("<sup>");
*
*
* @param out The StringBuilder to write to.
*/
public void openSuper(final StringBuilder out);
/**
* Called when a superscript span is closed.
*
* Default implementation is:
*
*
*
* out.append("</sup>");
*
*
* @param out The StringBuilder to write to.
*/
public void closeSuper(final StringBuilder out);
/**
* Called when an ordered list is opened.
*
* Default implementation is:
*
*
*
* out.append("<ol>\n");
*
*
* @param out The StringBuilder to write to.
*/
public void openOrderedList(final StringBuilder out);
/**
* Called when an ordered list is closed.
*
* Default implementation is:
*
*
*
* out.append("</ol>\n");
*
*
* @param out The StringBuilder to write to.
*/
public void closeOrderedList(final StringBuilder out);
/**
* Called when an unordered list is opened.
*
* Default implementation is:
*
*
*
* out.append("<ul>\n");
*
*
* @param out The StringBuilder to write to.
*/
public void openUnorderedList(final StringBuilder out);
/**
* Called when an unordered list is closed.
*
* Default implementation is:
*
*
*
* out.append("</ul>\n");
*
*
* @param out The StringBuilder to write to.
*/
public void closeUnorderedList(final StringBuilder out);
/**
* Called when a list item is opened.
*
* Note: Don't close the HTML tag!
*
*
* Default implementation is:
*
*
*
* out.append("<li");
*
*
* @param out The StringBuilder to write to.
*/
public void openListItem(final StringBuilder out);
/**
* Called when a list item is closed.
*
* Default implementation is:
*
*
*
* out.append("</li>\n");
*
*
* @param out The StringBuilder to write to.
*/
public void closeListItem(final StringBuilder out);
/**
* Called when a horizontal ruler is encountered.
*
* Default implementation is:
*
*
*
* out.append("<hr />\n");
*
*
* @param out The StringBuilder to write to.
*/
public void horizontalRuler(final StringBuilder out);
/**
* Called when a link is opened.
*
* Note: Don't close the HTML tag!
*
*
* Default implementation is:
*
*
*
* out.append("<a");
*
*
* @param out The StringBuilder to write to.
*/
public void openLink(final StringBuilder out);
/**
* Called when a link is closed
*
* Default implementation is:
*
*
*
* out.append("</a>");
*
*
* @param out The StringBuilder to write to.
*/
public void closeLink(final StringBuilder out);
/**
* Called when an image is opened.
*
* Note: Don't close the HTML tag!
*
*
* Default implementation is:
*
*
*
* out.append("<img");
*
*
* @param out The StringBuilder to write to.
*/
public void openImage(final StringBuilder out);
/**
* Called when an image is closed.
*
* Default implementation is:
*
*
*
* out.append(" />");
*
*
* @param out The StringBuilder to write to.
*/
public void closeImage(final StringBuilder out);
}