Class Text

java.lang.Object
win.dailypickle.report.html.Text

public final class Text extends Object
Escaping, pretty-printing, and formatting helpers for report output.

Two escaping contexts exist in the report and must not be mixed up: esc(java.lang.String) for text placed in HTML element/attribute content, and escJs(java.lang.String)/jsStr(java.lang.String) for text embedded in JavaScript string literals inside the inline <script> block.

  • Method Details

    • prettyPrint

      public static String prettyPrint(String content, String lang)
      Best-effort pretty-printer. XML is formatted through a real DOM parse + identity transform, so it must be well-formed — anything the parser rejects (including any DOCTYPE, which is disallowed against XXE) comes back unchanged. JSON goes through the streaming transform, which never validates: malformed JSON is still reformatted token-by-token, not returned unchanged. Other languages pass through as-is.
    • mimeToLanguage

      public static String mimeToLanguage(String mimeType)