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
ConstructorsModifierConstructorDescriptionprivate
PageParser
(String page, Map<String, Object> settings, int pos) -
Method Summary
Modifier and TypeMethodDescriptionstatic String
escapeHtml
(String s) Convert data to HTML, including newlines and multiple spaces.private static String
escapeHtml
(String s, boolean convertBreakAndSpace) (package private) static String
Convert data to HTML, but don't convert newlines and multiple spaces.(package private) static String
Escape text as a the javascript string.private Object
static String
Replace the tags in the HTML page with the given settings.private void
parseAll()
private String
parseBlockUntil
(String end) private void
private boolean
private String
private String
private void
private void
setError
(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
-