info.bliki.wiki.tags.code.AbstractCodeFormatter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bliki-core Show documentation
Show all versions of bliki-core Show documentation
This is the core project.
The newest version!
package info.bliki.wiki.tags.code;
import java.util.HashMap;
/**
* Abstract base class for alle SourceCodeFormatters
*
*/
abstract public class AbstractCodeFormatter implements SourceCodeFormatter {
public final static String FONT_KEYWORD = "";
// "";
public final static String FONT_OBJECTS = "";
// "";
public final static String FONT_COMMENT = "";
// = "";
public final static String FONT_STRINGS = "";
// = "";
public final static String FONT_JAVADOC = "";
// = "";
public final static String FONT_END = "";
public static void appendChar(StringBuilder result, char currentChar) {
switch (currentChar) {
case '\"': // special html escape character
result.append(""");
break;
case '<': // special html escape character
result.append("<");
break;
case '>': // special html escape character
result.append(">");
break;
case '&': // special html escape character
result.append("&");
break;
case '\'': // special html escape character
result.append("'");
break;
default:
result.append(currentChar);
}
}
public static void createHashMap(HashMap map, String str) {
map.put(str, FONT_KEYWORD + str + FONT_END);
}
public static void createObjectsMap(HashMap map, String str) {
map.put(str, FONT_OBJECTS + str + FONT_END);
}
/**
* @return Returns the KEYWORD_SET.
*/
abstract public HashMap getKeywordSet();
/**
* @return Returns the OBJECT_SET.
*/
abstract public HashMap getObjectSet();
}