com.softicar.platform.common.ui.wiki.SimpleWikiParserHtmlCallback Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.ui.wiki;
import com.softicar.platform.common.ui.color.IColor;
public class SimpleWikiParserHtmlCallback implements ISimpleWikiParserCallback {
private final StringBuilder html;
public SimpleWikiParserHtmlCallback() {
this.html = new StringBuilder();
}
public String getHtml() {
return html.toString();
}
public void clear() {
html.setLength(0);
}
@Override
public void addText(String text) {
html.append(text);
}
@Override
public void addWhitespace(String whitespace) {
html.append(" ");
}
@Override
public void addNewLine() {
html.append("
");
}
@Override
public void beginParagraph() {
html.append("");
}
@Override
public void endParagraph() {
html.append("
");
}
@Override
public void beginBold() {
html.append("");
}
@Override
public void endBold() {
html.append("");
}
@Override
public void beginItalic() {
html.append("");
}
@Override
public void endItalic() {
html.append("");
}
@Override
public void beginColor(IColor color) {
html.append(String.format("", color.toHtml()));
}
@Override
public void endColor() {
html.append("");
}
@Override
public void beginHeadLine(int level) {
html.append(String.format("", level));
}
@Override
public void endHeadLine(int level) {
html.append(String.format(" ", level));
}
@Override
public void beginUnorderedList() {
html.append("");
}
@Override
public void endUnorderedList() {
html.append("
");
}
@Override
public void beginOrderedList() {
html.append("");
}
@Override
public void endOrderedList() {
html.append("
");
}
@Override
public void beginListItem() {
html.append("");
}
@Override
public void endListItem() {
html.append(" ");
}
@Override
public void beginSection(int level) {
html.append("");
}
@Override
public void endSection() {
html.append("");
}
}