Class HtmlChangeReporter<T>

  • Type Parameters:
    T - The type of context value passed to the

    public final class HtmlChangeReporter<T>
    extends Object
    Sits between the HTML parser, the policy, and the renderer so that it can report dropped elements and attributes to an HtmlChangeListener.
     HtmlChangeReporter<T> hcr = new HtmlChangeReporter<T>(
       renderer, htmlChangeListener, context);
     hcr.setPolicy(policyFactory.apply(hcr.getWrappedRenderer()));
     HtmlSanitizer.sanitize(html, hcr.getWrappedPolicy());
     
    The renderer receives events from the policy unchanged, but the reporter notices differences between the events from the lexer and those from the policy.