1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2 <!--NewPage--> 3 <HTML> 4 <HEAD> 5 <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> 6 <TITLE> 7 HtmlChangeReporter (OWASP Java HTML Sanitizer) 8 </TITLE> 9 10 11 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> 12 13 <SCRIPT type="text/javascript"> 14 function windowTitle() 15 { 16 if (location.href.indexOf('is-external=true') == -1) { 17 parent.document.title="HtmlChangeReporter (OWASP Java HTML Sanitizer)"; 18 } 19 } 20 </SCRIPT> 21 <NOSCRIPT> 22 </NOSCRIPT> 23 24 </HEAD> 25 26 <BODY BGCOLOR="white" onload="windowTitle();"> 27 <HR> 28 29 30 <!-- ========= START OF TOP NAVBAR ======= --> 31 <A NAME="navbar_top"><!-- --></A> 32 <A HREF="#skip-navbar_top" title="Skip navigation links"></A> 33 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 34 <TR> 35 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 36 <A NAME="navbar_top_firstrow"><!-- --></A> 37 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 38 <TR ALIGN="center" VALIGN="top"> 39 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 41 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 42 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/HtmlChangeReporter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 46 </TR> 47 </TABLE> 48 </TD> 49 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 50 <a href="http://code.google.com/p/owasp-java-html-sanitizer" target=_top>code.google.com home</a></EM> 51 </TD> 52 </TR> 53 54 <TR> 55 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 56 <A HREF="../../../org/owasp/html/HtmlChangeListener.html" title="interface in org.owasp.html"><B>PREV CLASS</B></A> 57 <A HREF="../../../org/owasp/html/HtmlPolicyBuilder.html" title="class in org.owasp.html"><B>NEXT CLASS</B></A></FONT></TD> 58 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 59 <A HREF="../../../index.html?org/owasp/html/HtmlChangeReporter.html" target="_top"><B>FRAMES</B></A> 60 <A HREF="HtmlChangeReporter.html" target="_top"><B>NO FRAMES</B></A> 61 <SCRIPT type="text/javascript"> 62 <!-- 63 if(window==top) { 64 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); 65 } 66 //--> 67 </SCRIPT> 68 <NOSCRIPT> 69 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> 70 </NOSCRIPT> 71 72 73 </FONT></TD> 74 </TR> 75 <TR> 76 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 77 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 79 DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> 80 </TR> 81 </TABLE> 82 <A NAME="skip-navbar_top"></A> 83 <!-- ========= END OF TOP NAVBAR ========= --> 84 85 <HR> 86 <!-- ======== START OF CLASS DATA ======== --> 87 <H2> 88 <FONT SIZE="-1"> 89 org.owasp.html</FONT> 90 <BR> 91 Class HtmlChangeReporter<T></H2> 92 <PRE> 93 java.lang.Object 94 <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.owasp.html.HtmlChangeReporter<T></B> 95 </PRE> 96 <DL> 97 <DT><DT><B>Type Parameters:</B><DD><CODE>T</CODE> - The type of context value passed to the</DL> 98 <HR> 99 <DL> 100 <DT><PRE>public final class <A HREF="../../../src-html/org/owasp/html/HtmlChangeReporter.html#line.54"><B>HtmlChangeReporter<T></B></A><DT>extends java.lang.Object</DL> 101 </PRE> 102 103 <P> 104 Sits between the HTML parser, and then policy, and the renderer so that it 105 can report dropped elements and attributes to an <A HREF="../../../org/owasp/html/HtmlChangeListener.html" title="interface in org.owasp.html"><CODE>HtmlChangeListener</CODE></A>. 106 107 <pre> 108 HtmlChangeReporter<T> hcr = new HtmlChangeReporter<T>( 109 renderer, htmlChangeListener, context); 110 hcr.setPolicy(policyFactory.apply(hcr.getWrappedRenderer())); 111 HtmlSanitizer.sanitize(html, hcr.getWrappedPolicy()); 112 </pre> 113 114 The renderer receives events from the policy unchanged, but the reporter 115 notices differences between the events from the lexer and those from the 116 policy. 117 <P> 118 119 <P> 120 <HR> 121 122 <P> 123 124 <!-- ======== CONSTRUCTOR SUMMARY ======== --> 125 126 <A NAME="constructor_summary"><!-- --></A> 127 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 128 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 129 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 130 <B>Constructor Summary</B></FONT></TH> 131 </TR> 132 <TR BGCOLOR="white" CLASS="TableRowColor"> 133 <TD><CODE><B><A HREF="../../../org/owasp/html/HtmlChangeReporter.html#HtmlChangeReporter(org.owasp.html.HtmlStreamEventReceiver, org.owasp.html.HtmlChangeListener, T)">HtmlChangeReporter</A></B>(<A HREF="../../../org/owasp/html/HtmlStreamEventReceiver.html" title="interface in org.owasp.html">HtmlStreamEventReceiver</A> renderer, 134 <A HREF="../../../org/owasp/html/HtmlChangeListener.html" title="interface in org.owasp.html">HtmlChangeListener</A><? super <A HREF="../../../org/owasp/html/HtmlChangeReporter.html" title="type parameter in HtmlChangeReporter">T</A>> listener, 135 <A HREF="../../../org/owasp/html/HtmlChangeReporter.html" title="type parameter in HtmlChangeReporter">T</A> context)</CODE> 136 137 <BR> 138 </TD> 139 </TR> 140 </TABLE> 141 142 <!-- ========== METHOD SUMMARY =========== --> 143 144 <A NAME="method_summary"><!-- --></A> 145 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 146 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 147 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 148 <B>Method Summary</B></FONT></TH> 149 </TR> 150 <TR BGCOLOR="white" CLASS="TableRowColor"> 151 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 152 <CODE> <A HREF="../../../org/owasp/html/HtmlSanitizer.Policy.html" title="interface in org.owasp.html">HtmlSanitizer.Policy</A></CODE></FONT></TD> 153 <TD><CODE><B><A HREF="../../../org/owasp/html/HtmlChangeReporter.html#getWrappedPolicy()">getWrappedPolicy</A></B>()</CODE> 154 155 <BR> 156 </TD> 157 </TR> 158 <TR BGCOLOR="white" CLASS="TableRowColor"> 159 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 160 <CODE> <A HREF="../../../org/owasp/html/HtmlStreamEventReceiver.html" title="interface in org.owasp.html">HtmlStreamEventReceiver</A></CODE></FONT></TD> 161 <TD><CODE><B><A HREF="../../../org/owasp/html/HtmlChangeReporter.html#getWrappedRenderer()">getWrappedRenderer</A></B>()</CODE> 162 163 <BR> 164 </TD> 165 </TR> 166 <TR BGCOLOR="white" CLASS="TableRowColor"> 167 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 168 <CODE> void</CODE></FONT></TD> 169 <TD><CODE><B><A HREF="../../../org/owasp/html/HtmlChangeReporter.html#setPolicy(org.owasp.html.HtmlSanitizer.Policy)">setPolicy</A></B>(<A HREF="../../../org/owasp/html/HtmlSanitizer.Policy.html" title="interface in org.owasp.html">HtmlSanitizer.Policy</A> policy)</CODE> 170 171 <BR> 172 Associates an input channel.</TD> 173 </TR> 174 </TABLE> 175 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> 176 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 177 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 178 <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> 179 </TR> 180 <TR BGCOLOR="white" CLASS="TableRowColor"> 181 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> 182 </TR> 183 </TABLE> 184 185 <P> 186 187 <!-- ========= CONSTRUCTOR DETAIL ======== --> 188 189 <A NAME="constructor_detail"><!-- --></A> 190 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 191 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 192 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 193 <B>Constructor Detail</B></FONT></TH> 194 </TR> 195 </TABLE> 196 197 <A NAME="HtmlChangeReporter(org.owasp.html.HtmlStreamEventReceiver,org.owasp.html.HtmlChangeListener,java.lang.Object)"><!-- --></A><A NAME="HtmlChangeReporter(org.owasp.html.HtmlStreamEventReceiver, org.owasp.html.HtmlChangeListener, T)"><!-- --></A><H3> 198 HtmlChangeReporter</H3> 199 <PRE> 200 public <A HREF="../../../src-html/org/owasp/html/HtmlChangeReporter.html#line.58"><B>HtmlChangeReporter</B></A>(<A HREF="../../../org/owasp/html/HtmlStreamEventReceiver.html" title="interface in org.owasp.html">HtmlStreamEventReceiver</A> renderer, 201 <A HREF="../../../org/owasp/html/HtmlChangeListener.html" title="interface in org.owasp.html">HtmlChangeListener</A><? super <A HREF="../../../org/owasp/html/HtmlChangeReporter.html" title="type parameter in HtmlChangeReporter">T</A>> listener, 202 <FONT SIZE="-1">@Nullable</FONT> 203 <A HREF="../../../org/owasp/html/HtmlChangeReporter.html" title="type parameter in HtmlChangeReporter">T</A> context)</PRE> 204 <DL> 205 </DL> 206 207 <!-- ============ METHOD DETAIL ========== --> 208 209 <A NAME="method_detail"><!-- --></A> 210 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 211 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 212 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 213 <B>Method Detail</B></FONT></TH> 214 </TR> 215 </TABLE> 216 217 <A NAME="setPolicy(org.owasp.html.HtmlSanitizer.Policy)"><!-- --></A><H3> 218 setPolicy</H3> 219 <PRE> 220 public void <A HREF="../../../src-html/org/owasp/html/HtmlChangeReporter.html#line.69"><B>setPolicy</B></A>(<A HREF="../../../org/owasp/html/HtmlSanitizer.Policy.html" title="interface in org.owasp.html">HtmlSanitizer.Policy</A> policy)</PRE> 221 <DL> 222 <DD>Associates an input channel. <code>this</code> receives events and forwards 223 them to input. 224 <P> 225 <DD><DL> 226 </DL> 227 </DD> 228 </DL> 229 <HR> 230 231 <A NAME="getWrappedRenderer()"><!-- --></A><H3> 232 getWrappedRenderer</H3> 233 <PRE> 234 public <A HREF="../../../org/owasp/html/HtmlStreamEventReceiver.html" title="interface in org.owasp.html">HtmlStreamEventReceiver</A> <A HREF="../../../src-html/org/owasp/html/HtmlChangeReporter.html#line.73"><B>getWrappedRenderer</B></A>()</PRE> 235 <DL> 236 <DD><DL> 237 </DL> 238 </DD> 239 </DL> 240 <HR> 241 242 <A NAME="getWrappedPolicy()"><!-- --></A><H3> 243 getWrappedPolicy</H3> 244 <PRE> 245 public <A HREF="../../../org/owasp/html/HtmlSanitizer.Policy.html" title="interface in org.owasp.html">HtmlSanitizer.Policy</A> <A HREF="../../../src-html/org/owasp/html/HtmlChangeReporter.html#line.75"><B>getWrappedPolicy</B></A>()</PRE> 246 <DL> 247 <DD><DL> 248 </DL> 249 </DD> 250 </DL> 251 <!-- ========= END OF CLASS DATA ========= --> 252 <HR> 253 254 255 <!-- ======= START OF BOTTOM NAVBAR ====== --> 256 <A NAME="navbar_bottom"><!-- --></A> 257 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 258 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 259 <TR> 260 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 261 <A NAME="navbar_bottom_firstrow"><!-- --></A> 262 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 263 <TR ALIGN="center" VALIGN="top"> 264 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 265 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 266 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 267 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/HtmlChangeReporter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 268 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 269 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 270 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 271 </TR> 272 </TABLE> 273 </TD> 274 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 275 <a href="http://code.google.com/p/owasp-java-html-sanitizer" target=_top>code.google.com home</a></EM> 276 </TD> 277 </TR> 278 279 <TR> 280 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 281 <A HREF="../../../org/owasp/html/HtmlChangeListener.html" title="interface in org.owasp.html"><B>PREV CLASS</B></A> 282 <A HREF="../../../org/owasp/html/HtmlPolicyBuilder.html" title="class in org.owasp.html"><B>NEXT CLASS</B></A></FONT></TD> 283 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 284 <A HREF="../../../index.html?org/owasp/html/HtmlChangeReporter.html" target="_top"><B>FRAMES</B></A> 285 <A HREF="HtmlChangeReporter.html" target="_top"><B>NO FRAMES</B></A> 286 <SCRIPT type="text/javascript"> 287 <!-- 288 if(window==top) { 289 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); 290 } 291 //--> 292 </SCRIPT> 293 <NOSCRIPT> 294 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> 295 </NOSCRIPT> 296 297 298 </FONT></TD> 299 </TR> 300 <TR> 301 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 302 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 303 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 304 DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> 305 </TR> 306 </TABLE> 307 <A NAME="skip-navbar_bottom"></A> 308 <!-- ======== END OF BOTTOM NAVBAR ======= --> 309 310 <HR> 311 312 </BODY> 313 </HTML> 314