Package org.owasp.html
Class PolicyFactory
- java.lang.Object
-
- org.owasp.html.PolicyFactory
-
- All Implemented Interfaces:
com.google.common.base.Function<HtmlStreamEventReceiver,HtmlSanitizer.Policy>
@ThreadSafe @Immutable public final class PolicyFactory extends java.lang.Object implements com.google.common.base.Function<HtmlStreamEventReceiver,HtmlSanitizer.Policy>
A factory that can be used to link a sanitizer to an output receiver and that provides a convenientmethod and asanitizemethod to compose policies.and- Author:
- Mike Samuel
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PolicyFactoryand(PolicyFactory f)Produces a factory that allows the union of the grants, and intersects policies where they overlap on a particular granted attribute or element name.HtmlSanitizer.Policyapply(HtmlStreamEventReceiver out)Produces a sanitizer that emits tokens to out.java.lang.Stringsanitize(java.lang.String html)A convenience function that sanitizes a string of HTML.
-
-
-
Method Detail
-
apply
public HtmlSanitizer.Policy apply(HtmlStreamEventReceiver out)
Produces a sanitizer that emits tokens to out.- Specified by:
applyin interfacecom.google.common.base.Function<HtmlStreamEventReceiver,HtmlSanitizer.Policy>
-
sanitize
public java.lang.String sanitize(@Nullable java.lang.String html)A convenience function that sanitizes a string of HTML.
-
and
public PolicyFactory and(PolicyFactory f)
Produces a factory that allows the union of the grants, and intersects policies where they overlap on a particular granted attribute or element name.
-
-