private static void main()

in core/src/main/java/org/apache/calcite/avatica/SqlState.java [1815:1845]


  private static void main(String[] args) {
    PrintWriter pw = new PrintWriter(
        new BufferedWriter(
            new OutputStreamWriter(System.out, StandardCharsets.UTF_8)));
    pw.println(" * <table>");
    SqlState parent = null;
    for (SqlState s : values()) {
      assert s.klass.length() == 2;
      assert s.subClass == null || s.subClass.length() == 3;
      if (s.subClass == null) {
        assert s.subCondition == null;
        parent = s;
      } else {
        assert parent != null;
        assert s.subCondition != null;
        assert s.category == parent.category;
        assert s.klass.equals(parent.klass);
        assert s.condition.equals(parent.condition);
      }
      pw.println(" * <tr>");
      pw.println(" *   <td>" + (parent == s ? s.category : "&nbsp;") + "</td>");
      pw.println(" *   <td>" + (parent == s ? s.condition : "&nbsp;") + "</td>");
      pw.println(" *   <td>" + (parent == s ? s.klass : "&nbsp;") + "</td>");
      pw.println(" *   <td>" + (s.subCondition == null ? "(no subclass)" : s.subCondition)
          + "</td>");
      pw.println(" *   <td>" + (s.subCondition == null ? "000" : s.subClass) + "</td>");
      pw.println(" * </tr>");
    }
    pw.println(" * </table>");
    pw.close();
  }