public interface WhitelistConfiguration
WhitelistConfiguration interface.
| Modifier and Type | Method and Description |
|---|---|
void |
allowedAttributes(BiConsumer<String,List<String>> fn)
fn will be called once for each allowed tag
with the allowed attributes as the second argument, for
example accept('a',['href','rel'])
|
void |
allowedProtocols(BiConsumer<String,Map<String,List<String>>> fn)
fn will be called once for each allowed tag
with the allowed protocols as the second argument, for
example accept('a',{ 'href':['http','https'] })
|
void |
allowedTags(Consumer<String> fn)
fn will be called once for each allowed tag.
|
boolean |
allowsAttribute(String tagName,
String attrName) |
boolean |
allowsProtocol(String tagName,
String attrName,
String protocol)
allowsProtocol.
|
boolean |
allowsTag(String tagName) |
org.jsoup.safety.Whitelist |
apply(org.jsoup.safety.Whitelist whitelist)
Applies all the configured rules to the supplied
Whitelist instance. |
String |
base() |
void |
enforcedAttributes(BiConsumer<String,Map<String,String>> fn)
fn will be called once for each allowed tag
with the enforced attributes map as the second argument, for
example accept('a',{ 'rel':'nofollow' })
|
boolean |
enforcesAttribute(String tagName,
String attrName) |
boolean |
enforcesAttribute(String tagName,
String attrName,
String enforcedValue) |
boolean |
hasAllowedAttributes(String tagName) |
boolean |
hasAllowedProtocols(String tagName) |
boolean |
hasAllowedProtocols(String tagName,
String attrName) |
boolean |
hasEnforcedAttributes(String tagName) |
org.jsoup.safety.Whitelist |
whitelist()
Constructs an empty
Whitelist and applies the configured
rules to it. |
String base()
whitelist() is called.void allowedTags(Consumer<String> fn)
fn will be called once for each allowed tag.
fn - (non null) a Consumer object.void allowedAttributes(BiConsumer<String,List<String>> fn)
fn will be called once for each allowed tag with the allowed attributes as the second argument, for example accept('a',['href','rel'])
fn - a BiConsumer object.void enforcedAttributes(BiConsumer<String,Map<String,String>> fn)
fn will be called once for each allowed tag with the enforced attributes map as the second argument, for example accept('a',{ 'rel':'nofollow' })
fn - a BiConsumer object.void allowedProtocols(BiConsumer<String,Map<String,List<String>>> fn)
fn will be called once for each allowed tag with the allowed protocols as the second argument, for example accept('a',{ 'href':['http','https'] })
fn - a BiConsumer object.boolean allowsTag(String tagName)
tagName - (non null) a valid HTML tag nameboolean hasAllowedAttributes(String tagName)
tagName - (non null) a valid HTML tag nameboolean allowsAttribute(String tagName, String attrName)
tagName - (non null) a valid HTML tag nameattrName - (non null) a valid HTML attribute nameboolean hasEnforcedAttributes(String tagName)
tagName - (non null) a valid HTML tag nameboolean enforcesAttribute(String tagName, String attrName)
tagName - (non null) a valid HTML tag nameattrName - (non null) a valid HTML attribute nameboolean enforcesAttribute(String tagName, String attrName, String enforcedValue)
tagName - (non null) a valid HTML tag nameattrName - (non null) a valid HTML attribute nameenforcedValue - a String object.boolean hasAllowedProtocols(String tagName)
tagName - (non null) a valid HTML tag nameboolean hasAllowedProtocols(String tagName, String attrName)
tagName - (non null) a valid HTML tag nameattrName - (non null) a valid HTML attribute nameboolean allowsProtocol(String tagName, String attrName, String protocol)
allowsProtocol.
tagName - (non null) a valid HTML tag nameattrName - (non null) a valid HTML attribute nameprotocol - (non null) a protocol like 'https' or 'http'org.jsoup.safety.Whitelist apply(org.jsoup.safety.Whitelist whitelist)
Applies all the configured rules to the supplied Whitelist instance.
whitelist - a Whitelist object.Whitelist instance.org.jsoup.safety.Whitelist whitelist()
Constructs an empty Whitelist and applies the configured
rules to it.
Whitelist object.Copyright © 2016. All rights reserved.