org.hibernate.validator.constraints
Enum SafeHtml.WhiteListType

java.lang.Object
  extended by java.lang.Enum<SafeHtml.WhiteListType>
      extended by org.hibernate.validator.constraints.SafeHtml.WhiteListType
All Implemented Interfaces:
Serializable, Comparable<SafeHtml.WhiteListType>
Enclosing class:
SafeHtml

public static enum SafeHtml.WhiteListType
extends Enum<SafeHtml.WhiteListType>

Defines default whitelist implementations


Enum Constant Summary
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, 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, dl, dt, em, h1, h2, h3, h4, h5, h6, i, img, li, ol, p, pre, q, small, 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.

SIMPLE_TEXT
          This whitelist allows only simple text formatting: b, em, i, strong, u.
 
Method Summary
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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NONE

public static final SafeHtml.WhiteListType NONE
This whitelist allows only text nodes: all HTML will be stripped.


SIMPLE_TEXT

public static final SafeHtml.WhiteListType SIMPLE_TEXT
This whitelist allows only simple text formatting: b, em, i, strong, u. All other HTML (tags and attributes) will be removed.


BASIC

public static final SafeHtml.WhiteListType 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, 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.

Does not allow images.


BASIC_WITH_IMAGES

public static final SafeHtml.WhiteListType 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.


RELAXED

public static final SafeHtml.WhiteListType RELAXED
This whitelist allows a full range of text and structural body HTML: a, b, blockquote, br, caption, cite, code, col, colgroup, dd, dl, dt, em, h1, h2, h3, h4, h5, h6, i, img, li, ol, p, pre, q, small, 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.

Method Detail

values

public static SafeHtml.WhiteListType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SafeHtml.WhiteListType c : SafeHtml.WhiteListType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SafeHtml.WhiteListType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2007-2011 Red Hat Middleware, LLC. All Rights Reserved