code.google.com home

org.owasp.html
Interface ElementPolicy


public interface ElementPolicy

A policy that can be applied to an element to decide whether or not to allow it in the output, possibly after transforming attributes.

Element policies are applied after attribute policies so they can be used to add extra attributes.

Author:
Mike Samuel
See Also:
HtmlPolicyBuilder.allowElements(ElementPolicy, String...)

Nested Class Summary
static class ElementPolicy.Util
          Utilities for working with element policies.
 
Field Summary
static ElementPolicy IDENTITY_ELEMENT_POLICY
           
static ElementPolicy REJECT_ALL_ELEMENT_POLICY
           
 
Method Summary
 java.lang.String apply(java.lang.String elementName, java.util.List<java.lang.String> attrs)
           
 

Field Detail

IDENTITY_ELEMENT_POLICY

static final ElementPolicy IDENTITY_ELEMENT_POLICY

REJECT_ALL_ELEMENT_POLICY

static final ElementPolicy REJECT_ALL_ELEMENT_POLICY
Method Detail

apply

@Nullable
java.lang.String apply(java.lang.String elementName,
                                java.util.List<java.lang.String> attrs)
Parameters:
elementName - the lower-case element name.
attrs - a list of alternating attribute names and values. The list may be added to or removed from. When removing, be careful to remove both the name and its associated value.
Returns:
null to disallow the element, or the adjusted element name.

code.google.com home