@ProviderType
public interface XSSFilter
Modifier and Type | Field and Description |
---|---|
static ProtectionContext |
DEFAULT_CONTEXT
Default context.
|
Modifier and Type | Method and Description |
---|---|
boolean |
check(ProtectionContext context,
java.lang.String src)
Indicates whether or not a given source string contains XSS policy violations.
|
java.lang.String |
filter(ProtectionContext context,
java.lang.String src)
Protects the given source string from containing XSS stuff.
|
java.lang.String |
filter(java.lang.String src)
Prevents the given source string from containing XSS stuff.
|
boolean |
isValidHref(java.lang.String url)
Checks if the given URL is valid to be used for the
href attribute in a a tag. |
static final ProtectionContext DEFAULT_CONTEXT
boolean check(ProtectionContext context, java.lang.String src)
context
- context to use for checkingsrc
- source stringjava.lang.NullPointerException
- if context is null
java.lang.String filter(java.lang.String src)
The default protection context is used for checking.
src
- source stringjava.lang.String filter(ProtectionContext context, java.lang.String src)
context
- context to use for checkingsrc
- source stringjava.lang.NullPointerException
- if context is null
boolean isValidHref(java.lang.String url)
href
attribute in a a
tag.
The default protection context is used for checking.
url
- the URL that should be validatedCopyright © 2018 The Apache Software Foundation. All rights reserved.