public static enum SafeHtml.WhiteListType extends Enum<SafeHtml.WhiteListType>
Enum Constant and Description |
---|
BASIC
This whitelist allows a fuller range of text nodes:
a, b, blockquote, br, cite, code, dd, dl, dt, em, i, li, ol, p, pre, q, small, span, strike, strong, sub,
sup, u, ul , and appropriate attributes. |
BASIC_WITH_IMAGES
This whitelist allows the same text tags as
BASIC , and also allows img
tags,
with
appropriate attributes, with src pointing to http or https . |
NONE
This whitelist allows only text nodes: all HTML will be stripped.
|
RELAXED
This whitelist allows a full range of text and structural body HTML:
a, b, blockquote, br, caption, cite, code, col, colgroup, dd, div, dl, dt, em, h1, h2, h3, h4, h5, h6,
i, img, li, ol, p, pre, q, small, span, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, u,
ul |
SIMPLE_TEXT
This whitelist allows only simple text formatting:
b, em, i, strong, u . |
Modifier and Type | Method and Description |
---|---|
static SafeHtml.WhiteListType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SafeHtml.WhiteListType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SafeHtml.WhiteListType NONE
public static final SafeHtml.WhiteListType SIMPLE_TEXT
b, em, i, strong, u
. All other HTML (tags and
attributes) will be removed.public static final SafeHtml.WhiteListType BASIC
a, b, blockquote, br, cite, code, dd, dl, dt, em, i, li, ol, p, pre, q, small, span, strike, strong, sub,
sup, u, ul
, and appropriate attributes.
Links (a
elements) can point to http, https, ftp, mailto
, and have an enforced
rel=nofollow
attribute.
public static final SafeHtml.WhiteListType BASIC_WITH_IMAGES
BASIC
, and also allows img
tags,
with
appropriate attributes, with src
pointing to http
or https
.public static final SafeHtml.WhiteListType RELAXED
a, b, blockquote, br, caption, cite, code, col, colgroup, dd, div, dl, dt, em, h1, h2, h3, h4, h5, h6,
i, img, li, ol, p, pre, q, small, span, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, u,
ul
Links do not have an enforced rel=nofollow
attribute, but you can add that if desired.
public static SafeHtml.WhiteListType[] values()
for (SafeHtml.WhiteListType c : SafeHtml.WhiteListType.values()) System.out.println(c);
public static SafeHtml.WhiteListType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2021 JBoss by Red Hat. All rights reserved.