A builder that facilitates the building up of XSS-safe HTML from text snippets. It is used essentially like a {@link StringBuilder}; unlike a {@link StringBuilder}, it automatically HTML-escapes appended input where necessary.
In addition, it supports methods that allow strings with HTML markup to be appended without escaping: One can append other {@link SafeHtml} objects, andone can append constant strings. The method that appends constant strings ( {@link #appendHtmlConstant(String)}) requires a convention of use to be adhered to in order for this class to adhere to the contract required by {@link SafeHtml}: The argument expression must be fully determined and known to be safe at compile time, and the value of the argument must not contain incomplete HTML tags. See {@link #appendHtmlConstant(String)} for details.
The accumulated XSS-safe HTML can be obtained in the form of a {@link SafeHtml} via the {@link #toSafeHtml()} method.
This class is not thread-safe.