org.hibernate.validator.constraints

## Annotation Type SafeHtml

-     @Documented
      @Constraint(validatedBy={})
      @Target(value={METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER})
      @Retention(value=RUNTIME)
      public @interface SafeHtml

  Validate a rich text value provided by the user to ensure that it contains no malicious code, such as embedded <script> elements.
  Author:
    George Gastaldi

- - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `String[]` | `additionalTags`
    `SafeHtml.Tag[]` | `additionalTagsWithAttributes`
    `Class<?>[]` | `groups`
    `String` | `message`
    `Class<? extends Payload>[]` | `payload`
    `SafeHtml.WhiteListType` | `whitelistType`

- - ### Element Detail

    - #### message

          public abstract String message

      Default:
        "{org.hibernate.validator.constraints.SafeHtml.message}"

    - #### groups

          public abstract Class<?>[] groups

      Default:
        {}

    - #### payload

          public abstract Class<? extends Payload>[] payload

      Default:
        {}

    - #### whitelistType

          public abstract SafeHtml.WhiteListType whitelistType

      Returns:
        The built-in whitelist type which will be applied to the rich text value
      Default:
        org.hibernate.validator.constraints.SafeHtml.WhiteListType.RELAXED

    - #### additionalTags

          public abstract String[] additionalTags

      Returns:
        Additional whitelist tags which are allowed on top of the tags specified by the `whitelistType()`.
      Default:
        {}

    - #### additionalTagsWithAttributes

          public abstract SafeHtml.Tag[] additionalTagsWithAttributes

      Returns:
        Allows to specify additional whitelist tags with optional attributes.
      Default:
        {}

Copyright © 2007-2014 Red Hat, Inc. All Rights Reserved