Class PageParser

java.lang.Object
org.h2.server.web.PageParser

public class PageParser extends Object
A page parser can parse an HTML page and replace the tags there. This class is used by the H2 Console.
  • Field Details

  • Constructor Details

  • Method Details

    • parse

      public static String parse(String page, Map<String,Object> settings)
      Replace the tags in the HTML page with the given settings.
      Parameters:
      page - the HTML page
      settings - the settings
      Returns:
      the converted page
    • setError

      private void setError(int i)
    • parseBlockUntil

      private String parseBlockUntil(String end) throws ParseException
      Throws:
      ParseException
    • replaceTags

      private String replaceTags()
    • parseAll

      private void parseAll() throws ParseException
      Throws:
      ParseException
    • get

      private Object get(String item)
    • replaceTags

      private void replaceTags(String s)
    • readParam

      private String readParam(String name) throws ParseException
      Throws:
      ParseException
    • skipSpaces

      private void skipSpaces()
    • read

      private void read(String s) throws ParseException
      Throws:
      ParseException
    • readIf

      private boolean readIf(String s)
    • escapeHtmlData

      static String escapeHtmlData(String s)
      Convert data to HTML, but don't convert newlines and multiple spaces.
      Parameters:
      s - the data
      Returns:
      the escaped html text
    • escapeHtml

      public static String escapeHtml(String s)
      Convert data to HTML, including newlines and multiple spaces.
      Parameters:
      s - the data
      Returns:
      the escaped html text
    • escapeHtml

      private static String escapeHtml(String s, boolean convertBreakAndSpace)
    • escapeJavaScript

      static String escapeJavaScript(String s)
      Escape text as a the javascript string.
      Parameters:
      s - the text
      Returns:
      the javascript string