Package org.h2.server.web
Class PageParser
java.lang.Object
org.h2.server.web.PageParser
A page parser can parse an HTML page and replace the tags there.
This class is used by the H2 Console.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePageParser(String page, Map<String, Object> settings, int pos) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringescapeHtml(String s) Convert data to HTML, including newlines and multiple spaces.private static StringescapeHtml(String s, boolean convertBreakAndSpace) (package private) static StringConvert data to HTML, but don't convert newlines and multiple spaces.(package private) static StringEscape text as a the javascript string.private Objectstatic StringReplace the tags in the HTML page with the given settings.private voidparseAll()private StringparseBlockUntil(String end) private voidprivate booleanprivate Stringprivate Stringprivate voidprivate voidsetError(int i) private void
-
Field Details
-
TAB_WIDTH
private static final int TAB_WIDTH- See Also:
-
page
-
pos
private int pos -
settings
-
len
private final int len -
result
-
-
Constructor Details
-
PageParser
-
-
Method Details
-
parse
Replace the tags in the HTML page with the given settings.- Parameters:
page- the HTML pagesettings- the settings- Returns:
- the converted page
-
setError
private void setError(int i) -
parseBlockUntil
- Throws:
ParseException
-
replaceTags
-
parseAll
- Throws:
ParseException
-
get
-
replaceTags
-
readParam
- Throws:
ParseException
-
skipSpaces
private void skipSpaces() -
read
- Throws:
ParseException
-
readIf
-
escapeHtmlData
Convert data to HTML, but don't convert newlines and multiple spaces.- Parameters:
s- the data- Returns:
- the escaped html text
-
escapeHtml
Convert data to HTML, including newlines and multiple spaces.- Parameters:
s- the data- Returns:
- the escaped html text
-
escapeHtml
-
escapeJavaScript
Escape text as a the javascript string.- Parameters:
s- the text- Returns:
- the javascript string
-