Package org.owasp.html
Interface ElementPolicy
-
- All Known Subinterfaces:
ElementPolicy.JoinableElementPolicy
public interface ElementPolicyA 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 policiesso they can be used to add extra attributes.- Author:
- Mike Samuel ([email protected])
- See Also:
HtmlPolicyBuilder.allowElements(ElementPolicy, String...)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceElementPolicy.JoinableElementPolicystatic classElementPolicy.UtilUtilities for working with element policies.
-
Field Summary
Fields Modifier and Type Field Description static ElementPolicyIDENTITY_ELEMENT_POLICYAn element policy that returns the element unchanged.static ElementPolicyREJECT_ALL_ELEMENT_POLICYAn element policy that rejects all elements.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringapply(String elementName, List<String> attrs)
-
-
-
Field Detail
-
IDENTITY_ELEMENT_POLICY
static final ElementPolicy IDENTITY_ELEMENT_POLICY
An element policy that returns the element unchanged.
-
REJECT_ALL_ELEMENT_POLICY
static final ElementPolicy REJECT_ALL_ELEMENT_POLICY
An element policy that rejects all elements.
-
-
Method Detail
-
apply
@Nullable String apply(String elementName, List<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:
nullto disallow the element, or the adjusted element name.
-
-