public final class MockXSSAPIImpl extends Object implements org.apache.sling.xss.XSSAPI
XSSAPI which in most cases just returns
the value that was passed in, or does only very basic validation.| Constructor and Description |
|---|
MockXSSAPIImpl() |
| Modifier and Type | Method and Description |
|---|---|
@Nullable String |
encodeForCSSString(@Nullable String source) |
@Nullable String |
encodeForHTML(@Nullable String source) |
@Nullable String |
encodeForHTMLAttr(@Nullable String source) |
@Nullable String |
encodeForJSString(@Nullable String source) |
@Nullable String |
encodeForXML(@Nullable String source) |
@Nullable String |
encodeForXMLAttr(@Nullable String source) |
@NotNull String |
filterHTML(@Nullable String source) |
@Nullable String |
getValidCSSColor(@Nullable String color,
@Nullable String defaultColor) |
@Nullable String |
getValidDimension(@Nullable String dimension,
@Nullable String defaultValue) |
@Nullable Double |
getValidDouble(@Nullable String source,
double defaultValue) |
@NotNull String |
getValidHref(@Nullable String url) |
@Nullable Integer |
getValidInteger(@Nullable String integer,
int defaultValue) |
String |
getValidJSON(@Nullable String json,
@Nullable String defaultJson) |
@Nullable String |
getValidJSToken(@Nullable String token,
@Nullable String defaultValue) |
@Nullable Long |
getValidLong(@Nullable String source,
long defaultValue) |
String |
getValidMultiLineComment(@Nullable String comment,
@Nullable String defaultComment) |
@Nullable String |
getValidStyleToken(@Nullable String token,
@Nullable String defaultValue) |
String |
getValidXML(@Nullable String xml,
@Nullable String defaultXml) |
@Nullable public @Nullable Integer getValidInteger(@Nullable @Nullable String integer, int defaultValue)
getValidInteger in interface org.apache.sling.xss.XSSAPI@Nullable public @Nullable Long getValidLong(@Nullable @Nullable String source, long defaultValue)
getValidLong in interface org.apache.sling.xss.XSSAPI@Nullable public @Nullable Double getValidDouble(@Nullable @Nullable String source, double defaultValue)
getValidDouble in interface org.apache.sling.xss.XSSAPI@Nullable public @Nullable String getValidDimension(@Nullable @Nullable String dimension, @Nullable @Nullable String defaultValue)
getValidDimension in interface org.apache.sling.xss.XSSAPI@NotNull public @NotNull String getValidHref(@Nullable @Nullable String url)
getValidHref in interface org.apache.sling.xss.XSSAPI@Nullable public @Nullable String getValidJSToken(@Nullable @Nullable String token, @Nullable @Nullable String defaultValue)
getValidJSToken in interface org.apache.sling.xss.XSSAPI@Nullable public @Nullable String getValidStyleToken(@Nullable @Nullable String token, @Nullable @Nullable String defaultValue)
getValidStyleToken in interface org.apache.sling.xss.XSSAPI@Nullable public @Nullable String getValidCSSColor(@Nullable @Nullable String color, @Nullable @Nullable String defaultColor)
getValidCSSColor in interface org.apache.sling.xss.XSSAPIpublic String getValidMultiLineComment(@Nullable @Nullable String comment, @Nullable @Nullable String defaultComment)
getValidMultiLineComment in interface org.apache.sling.xss.XSSAPIpublic String getValidJSON(@Nullable @Nullable String json, @Nullable @Nullable String defaultJson)
getValidJSON in interface org.apache.sling.xss.XSSAPIpublic String getValidXML(@Nullable @Nullable String xml, @Nullable @Nullable String defaultXml)
getValidXML in interface org.apache.sling.xss.XSSAPI@Nullable public @Nullable String encodeForHTML(@Nullable @Nullable String source)
encodeForHTML in interface org.apache.sling.xss.XSSAPI@Nullable public @Nullable String encodeForHTMLAttr(@Nullable @Nullable String source)
encodeForHTMLAttr in interface org.apache.sling.xss.XSSAPI@Nullable public @Nullable String encodeForXML(@Nullable @Nullable String source)
encodeForXML in interface org.apache.sling.xss.XSSAPI@Nullable public @Nullable String encodeForXMLAttr(@Nullable @Nullable String source)
encodeForXMLAttr in interface org.apache.sling.xss.XSSAPI@Nullable public @Nullable String encodeForJSString(@Nullable @Nullable String source)
encodeForJSString in interface org.apache.sling.xss.XSSAPI@Nullable public @Nullable String encodeForCSSString(@Nullable @Nullable String source)
encodeForCSSString in interface org.apache.sling.xss.XSSAPICopyright © 2007–2020 The Apache Software Foundation. All rights reserved.