Class DynamicAttributesSanitizerPolicy

java.lang.Object
org.owasp.html.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 Details

    • DynamicAttributesSanitizerPolicy

      public DynamicAttributesSanitizerPolicy(org.owasp.html.HtmlStreamEventReceiver out, Map<String,org.owasp.html.ElementAndAttributePolicies> elAndAttrPolicies, Set<String> allowedTextContainers, Map<String,org.owasp.html.AttributePolicy> dynamicAttributesPolicyMap, List<String> onInvalidRemoveTagList)
  • Method Details

    • 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