public class DefaultDecorator extends Object implements Decorator
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\">");
}
}
| Constructor and Description |
|---|
DefaultDecorator()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeBlockquote(StringBuilder out)
Called when a blockquote is closed.
|
void |
closeCodeBlock(StringBuilder out)
Called when a code block is closed.
|
void |
closeCodeSpan(StringBuilder out)
Called when a code span is closed.
|
void |
closeEmphasis(StringBuilder out)
Called when an emphasis span is closed.
|
void |
closeHeadline(StringBuilder out,
int level)
Called when a headline is closed.
|
void |
closeImage(StringBuilder out)
Called when an image is closed.
|
void |
closeLink(StringBuilder out)
Called when a link is closed
|
void |
closeListItem(StringBuilder out)
Called when a list item is closed.
|
void |
closeOrderedList(StringBuilder out)
Called when an ordered list is closed.
|
void |
closeParagraph(StringBuilder out)
Called when a paragraph is closed.
|
void |
closeStrong(StringBuilder out)
Called when a strong span is closed.
|
void |
closeSuper(StringBuilder out)
Called when a superscript span is closed.
|
void |
closeUnorderedList(StringBuilder out)
Called when an unordered list is closed.
|
void |
horizontalRuler(StringBuilder out)
Called when a horizontal ruler is encountered.
|
void |
openBlockquote(StringBuilder out)
Called when a blockquote is opened.
|
void |
openCodeBlock(StringBuilder out)
Called when a code block is opened.
|
void |
openCodeSpan(StringBuilder out)
Called when a code span is opened.
|
void |
openEmphasis(StringBuilder out)
Called when an emphasis span is opened.
|
void |
openHeadline(StringBuilder out,
int level)
Called when a headline is opened.
|
void |
openImage(StringBuilder out)
Called when an image is opened.
|
void |
openLink(StringBuilder out)
Called when a link is opened.
|
void |
openListItem(StringBuilder out)
Called when a list item is opened.
|
void |
openOrderedList(StringBuilder out)
Called when an ordered list is opened.
|
void |
openParagraph(StringBuilder out)
Called when a paragraph is opened.
|
void |
openStrong(StringBuilder out)
Called when a strong span is opened.
|
void |
openSuper(StringBuilder out)
Called when a superscript span is opened.
|
void |
openUnorderedList(StringBuilder out)
Called when an unordered list is opened.
|
public void openParagraph(StringBuilder out)
DecoratorDefault implementation is:
out.append("<p>");
openParagraph in interface Decoratorout - The StringBuilder to write to.Decorator.openParagraph(StringBuilder)public void closeParagraph(StringBuilder out)
DecoratorDefault implementation is:
out.append("</p>\n");
closeParagraph in interface Decoratorout - The StringBuilder to write to.Decorator.closeParagraph(StringBuilder)public void openBlockquote(StringBuilder out)
Decorator
out.append("<blockquote>");
openBlockquote in interface Decoratorout - The StringBuilder to write to.Decorator.openBlockquote(StringBuilder)public void closeBlockquote(StringBuilder out)
DecoratorDefault implementation is:
out.append("</blockquote>\n");
closeBlockquote in interface Decoratorout - The StringBuilder to write to.Decorator.closeBlockquote(StringBuilder)public void openCodeBlock(StringBuilder out)
DecoratorDefault implementation is:
out.append("<pre><code>");
openCodeBlock in interface Decoratorout - The StringBuilder to write to.Decorator.openCodeBlock(StringBuilder)public void closeCodeBlock(StringBuilder out)
DecoratorDefault implementation is:
out.append("</code></pre>\n");
closeCodeBlock in interface Decoratorout - The StringBuilder to write to.Decorator.closeCodeBlock(StringBuilder)public void openCodeSpan(StringBuilder out)
DecoratorDefault implementation is:
out.append("<code>");
openCodeSpan in interface Decoratorout - The StringBuilder to write to.Decorator.openCodeSpan(StringBuilder)public void closeCodeSpan(StringBuilder out)
DecoratorDefault implementation is:
out.append("</code>");
closeCodeSpan in interface Decoratorout - The StringBuilder to write to.Decorator.closeCodeSpan(StringBuilder)public void openHeadline(StringBuilder out, int level)
DecoratorNote: Don't close the HTML tag!
Default implementation is:
out.append("<h");
out.append(level);
openHeadline in interface Decoratorout - The StringBuilder to write to.level - The level to use.Decorator.openHeadline(StringBuilder,
int)public void closeHeadline(StringBuilder out, int level)
DecoratorDefault implementation is:
out.append("</h");
out.append(level);
out.append(">\n");
closeHeadline in interface Decoratorout - The StringBuilder to write to.level - The level to use.Decorator.closeHeadline(StringBuilder,
int)public void openStrong(StringBuilder out)
DecoratorDefault implementation is:
out.append("<strong>");
openStrong in interface Decoratorout - The StringBuilder to write to.Decorator.openStrong(StringBuilder)public void closeStrong(StringBuilder out)
DecoratorDefault implementation is:
out.append("</strong>");
closeStrong in interface Decoratorout - The StringBuilder to write to.Decorator.closeStrong(StringBuilder)public void openEmphasis(StringBuilder out)
DecoratorDefault implementation is:
out.append("<em>");
openEmphasis in interface Decoratorout - The StringBuilder to write to.Decorator.openEmphasis(StringBuilder)public void closeEmphasis(StringBuilder out)
DecoratorDefault implementation is:
out.append("</em>");
closeEmphasis in interface Decoratorout - The StringBuilder to write to.Decorator.closeEmphasis(StringBuilder)public void openSuper(StringBuilder out)
DecoratorDefault implementation is:
out.append("<sup>");
openSuper in interface Decoratorout - The StringBuilder to write to.Decorator.openSuper(StringBuilder)public void closeSuper(StringBuilder out)
DecoratorDefault implementation is:
out.append("</sup>");
closeSuper in interface Decoratorout - The StringBuilder to write to.Decorator.closeSuper(StringBuilder)public void openOrderedList(StringBuilder out)
DecoratorDefault implementation is:
out.append("<ol>\n");
openOrderedList in interface Decoratorout - The StringBuilder to write to.Decorator.openOrderedList(StringBuilder)public void closeOrderedList(StringBuilder out)
DecoratorDefault implementation is:
out.append("</ol>\n");
closeOrderedList in interface Decoratorout - The StringBuilder to write to.Decorator.closeOrderedList(StringBuilder)public void openUnorderedList(StringBuilder out)
DecoratorDefault implementation is:
out.append("<ul>\n");
openUnorderedList in interface Decoratorout - The StringBuilder to write to.Decorator.openUnorderedList(StringBuilder)public void closeUnorderedList(StringBuilder out)
DecoratorDefault implementation is:
out.append("</ul>\n");
closeUnorderedList in interface Decoratorout - The StringBuilder to write to.Decorator.closeUnorderedList(StringBuilder)public void openListItem(StringBuilder out)
DecoratorNote: Don't close the HTML tag!
Default implementation is:
out.append("<li");
openListItem in interface Decoratorout - The StringBuilder to write to.Decorator.openListItem(StringBuilder)public void closeListItem(StringBuilder out)
DecoratorDefault implementation is:
out.append("</li>\n");
closeListItem in interface Decoratorout - The StringBuilder to write to.Decorator.closeListItem(StringBuilder)public void horizontalRuler(StringBuilder out)
DecoratorDefault implementation is:
out.append("<hr />\n");
horizontalRuler in interface Decoratorout - The StringBuilder to write to.Decorator.horizontalRuler(StringBuilder)public void openLink(StringBuilder out)
DecoratorNote: Don't close the HTML tag!
Default implementation is:
out.append("<a");
openLink in interface Decoratorout - The StringBuilder to write to.Decorator.openLink(StringBuilder)public void closeLink(StringBuilder out)
DecoratorDefault implementation is:
out.append("</a>");
closeLink in interface Decoratorout - The StringBuilder to write to.Decorator.closeLink(StringBuilder)public void openImage(StringBuilder out)
DecoratorNote: Don't close the HTML tag!
Default implementation is:
out.append("<img");
openImage in interface Decoratorout - The StringBuilder to write to.Decorator.openImage(StringBuilder)public void closeImage(StringBuilder out)
DecoratorDefault implementation is:
out.append(" />");
closeImage in interface Decoratorout - The StringBuilder to write to.Decorator.closeImage(StringBuilder)Copyright © 2015. All Rights Reserved.