Class DynamicAttributesSanitizerPolicy

  • All Implemented Interfaces:
    org.owasp.html.HtmlSanitizer.Policy, org.owasp.html.HtmlStreamEventReceiver

    public class DynamicAttributesSanitizerPolicy
    extends Object
    Extends the default policy to support dynamic attributes. Since we want to support the antisamy config file, we have to make dynamic tag attributes possible. It is placed in the 'org.owasp.html' package because there are package private fields.
    • Constructor Detail

      • DynamicAttributesSanitizerPolicy

        public DynamicAttributesSanitizerPolicy​(org.owasp.html.HtmlStreamEventReceiver out,
                                                com.google.common.collect.ImmutableMap<String,​org.owasp.html.ElementAndAttributePolicies> elAndAttrPolicies,
                                                com.google.common.collect.ImmutableSet<String> allowedTextContainers,
                                                Map<String,​org.owasp.html.AttributePolicy> dynamicAttributesPolicyMap,
                                                List<String> onInvalidRemoveTagList)
    • Method Detail

      • openTag

        public void openTag​(String elementName,
                            List<String> attrs)
        Specified by:
        openTag in interface org.owasp.html.HtmlSanitizer.Policy
        Specified by:
        openTag in interface org.owasp.html.HtmlStreamEventReceiver
      • getNumberOfErrors

        public int getNumberOfErrors()
      • openDocument

        public void openDocument()
        Specified by:
        openDocument in interface org.owasp.html.HtmlStreamEventReceiver
      • closeDocument

        public void closeDocument()
        Specified by:
        closeDocument in interface org.owasp.html.HtmlStreamEventReceiver
      • text

        public void text​(String arg0)
        Specified by:
        text in interface org.owasp.html.HtmlSanitizer.Policy
        Specified by:
        text in interface org.owasp.html.HtmlStreamEventReceiver
      • closeTag

        public void closeTag​(String arg0)
        Specified by:
        closeTag in interface org.owasp.html.HtmlSanitizer.Policy
        Specified by:
        closeTag in interface org.owasp.html.HtmlStreamEventReceiver