Class MarkdownDefaultDecorator
- java.lang.Object
-
- com.helger.html.markdown.MarkdownDefaultDecorator
-
- All Implemented Interfaces:
IMarkdownDecorator
public class MarkdownDefaultDecorator extends Object implements IMarkdownDecorator
Default Decorator implementation.Example for a user Decorator having a class attribute on <p> tags.
public class MyDecorator extends DefaultDecorator { @Override public void openParagraph(StringBuilder out) { out.append("<p class=\"myclass\">"); } }- Author:
- René Jeschke <rene_jeschke@yahoo.de>
-
-
Constructor Summary
Constructors Constructor Description MarkdownDefaultDecorator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendHorizontalRuler(com.helger.html.markdown.MarkdownHCStack out)Called when a horizontal ruler is encountered.HCImgappendImage(com.helger.html.markdown.MarkdownHCStack out)Called when an image is opened.voidcloseBlockquote(com.helger.html.markdown.MarkdownHCStack out)Called when a blockquote is closed.voidcloseCodeBlock(com.helger.html.markdown.MarkdownHCStack out)Called when a code block is closed.voidcloseCodeSpan(com.helger.html.markdown.MarkdownHCStack out)Called when a code span is closed.voidcloseEmphasis(com.helger.html.markdown.MarkdownHCStack out)Called when an emphasis span is closed.voidcloseHeadline(com.helger.html.markdown.MarkdownHCStack out, int level)Called when a headline is closed.voidcloseLink(com.helger.html.markdown.MarkdownHCStack out)voidcloseListItem(com.helger.html.markdown.MarkdownHCStack out)Called when a list item is closed.voidcloseOrderedList(com.helger.html.markdown.MarkdownHCStack out)Called when an ordered list is closed.voidcloseParagraph(com.helger.html.markdown.MarkdownHCStack out)Called when a paragraph is closed.voidcloseStrike(com.helger.html.markdown.MarkdownHCStack out)Called when a strike span is closed.voidcloseStrong(com.helger.html.markdown.MarkdownHCStack out)Called when a strong span is closed.voidcloseSuper(com.helger.html.markdown.MarkdownHCStack out)Called when a superscript span is closed.voidcloseUnorderedList(com.helger.html.markdown.MarkdownHCStack out)Called when an unordered list is closed.voidopenBlockquote(com.helger.html.markdown.MarkdownHCStack out)Called when a blockquote is opened.voidopenCodeBlock(com.helger.html.markdown.MarkdownHCStack out)Called when a code block is opened.HCCodeopenCodeSpan(com.helger.html.markdown.MarkdownHCStack out)Called when a code span is opened.voidopenEmphasis(com.helger.html.markdown.MarkdownHCStack out)Called when an emphasis span is opened.IHCElementWithChildren<?>openHeadline(com.helger.html.markdown.MarkdownHCStack out, int level)Called when a headline is opened.HCAopenLink(com.helger.html.markdown.MarkdownHCStack out)Called when a link is opened.HCLIopenListItem(com.helger.html.markdown.MarkdownHCStack out)Called when a list item is opened.voidopenOrderedList(com.helger.html.markdown.MarkdownHCStack out)Called when an ordered list is opened.voidopenParagraph(com.helger.html.markdown.MarkdownHCStack out)Called when a paragraph is opened.voidopenStrike(com.helger.html.markdown.MarkdownHCStack out)Called when a strike span is opened.voidopenStrong(com.helger.html.markdown.MarkdownHCStack out)Called when a strong span is opened.voidopenSuper(com.helger.html.markdown.MarkdownHCStack out)Called when a superscript span is opened.voidopenUnorderedList(com.helger.html.markdown.MarkdownHCStack out)Called when an unordered list is opened.
-
-
-
Method Detail
-
openParagraph
public void openParagraph(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a paragraph is opened.Default implementation is:
out.append("<p>");- Specified by:
openParagraphin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
closeParagraph
public void closeParagraph(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a paragraph is closed.Default implementation is:
out.append("</p>\n");- Specified by:
closeParagraphin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
openBlockquote
public void openBlockquote(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a blockquote is opened. Default implementation is:out.append("<blockquote>");- Specified by:
openBlockquotein interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
closeBlockquote
public void closeBlockquote(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a blockquote is closed.Default implementation is:
out.append("</blockquote>\n");- Specified by:
closeBlockquotein interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
openCodeBlock
public void openCodeBlock(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a code block is opened.Default implementation is:
out.append("<pre><code>");- Specified by:
openCodeBlockin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
closeCodeBlock
public void closeCodeBlock(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a code block is closed.Default implementation is:
out.append("</code></pre>\n");- Specified by:
closeCodeBlockin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
openCodeSpan
@Nonnull public HCCode openCodeSpan(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a code span is opened.Default implementation is:
out.append("<code>");- Specified by:
openCodeSpanin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.- Returns:
- code element
-
closeCodeSpan
public void closeCodeSpan(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a code span is closed.Default implementation is:
out.append("</code>");- Specified by:
closeCodeSpanin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
openHeadline
@Nonnull public IHCElementWithChildren<?> openHeadline(@Nonnull com.helger.html.markdown.MarkdownHCStack out, int level)
Description copied from interface:IMarkdownDecoratorCalled when a headline is opened.Note: Don't close the HTML tag!
Default implementation is:
out.append("<h"); out.append(level);- Specified by:
openHeadlinein interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.level- Headline level- Returns:
- Headline element
-
closeHeadline
public void closeHeadline(@Nonnull com.helger.html.markdown.MarkdownHCStack out, int level)
Description copied from interface:IMarkdownDecoratorCalled when a headline is closed.Default implementation is:
out.append("</h"); out.append(level); out.append(">\n");- Specified by:
closeHeadlinein interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.level- Headline level
-
openStrong
public void openStrong(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a strong span is opened.Default implementation is:
out.append("<strong>");- Specified by:
openStrongin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
closeStrong
public void closeStrong(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a strong span is closed.Default implementation is:
out.append("</strong>");- Specified by:
closeStrongin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
openStrike
public void openStrike(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a strike span is opened.Default implementation is:
out.append("<s>");- Specified by:
openStrikein interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
closeStrike
public void closeStrike(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a strike span is closed.Default implementation is:
out.append("</s>");- Specified by:
closeStrikein interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
openEmphasis
public void openEmphasis(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when an emphasis span is opened.Default implementation is:
out.append("<em>");- Specified by:
openEmphasisin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
closeEmphasis
public void closeEmphasis(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when an emphasis span is closed.Default implementation is:
out.append("</em>");- Specified by:
closeEmphasisin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
openSuper
public void openSuper(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a superscript span is opened.Default implementation is:
out.append("<sup>");- Specified by:
openSuperin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
closeSuper
public void closeSuper(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a superscript span is closed.Default implementation is:
out.append("</sup>");- Specified by:
closeSuperin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
openOrderedList
public void openOrderedList(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when an ordered list is opened.Default implementation is:
out.append("<ol>\n");- Specified by:
openOrderedListin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
closeOrderedList
public void closeOrderedList(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when an ordered list is closed.Default implementation is:
out.append("</ol>\n");- Specified by:
closeOrderedListin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
openUnorderedList
public void openUnorderedList(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when an unordered list is opened.Default implementation is:
out.append("<ul>\n");- Specified by:
openUnorderedListin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
closeUnorderedList
public void closeUnorderedList(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when an unordered list is closed.Default implementation is:
out.append("</ul>\n");- Specified by:
closeUnorderedListin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
openListItem
@Nonnull public HCLI openListItem(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a list item is opened.Note: Don't close the HTML tag!
Default implementation is:
out.append("<li");- Specified by:
openListItemin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.- Returns:
- List item element
-
closeListItem
public void closeListItem(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a list item is closed.Default implementation is:
out.append("</li>\n");- Specified by:
closeListItemin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
appendHorizontalRuler
public void appendHorizontalRuler(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a horizontal ruler is encountered.Default implementation is:
out.append("<hr />\n");- Specified by:
appendHorizontalRulerin interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.
-
openLink
@Nonnull public HCA openLink(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when a link is opened.Note: Don't close the HTML tag!
Default implementation is:
out.append("<a");- Specified by:
openLinkin interfaceIMarkdownDecorator- Parameters:
out- The stack to write to.- Returns:
- Link element
-
closeLink
public void closeLink(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
- Specified by:
closeLinkin interfaceIMarkdownDecorator
-
appendImage
@Nonnull public HCImg appendImage(@Nonnull com.helger.html.markdown.MarkdownHCStack out)
Description copied from interface:IMarkdownDecoratorCalled when an image is opened.Note: Don't close the HTML tag!
Default implementation is:
out.append("<img");- Specified by:
appendImagein interfaceIMarkdownDecorator- Parameters:
out- The StringBuilder to write to.- Returns:
- Image element
-
-