Annotation Type ValidHtml


  • @Documented
    @Constraint(validatedBy=ValidHtmlValidator.class)
    @Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
    @Retention(RUNTIME)
    @Repeatable(List.class)
    public @interface ValidHtml
    Constraint validation annotation that may be applied to Strings. Checks that the string, if it is not empty, represents a valid HTML fragment.

    Does not check for null values, use NotNull for that.

    Does not check for empty or blank values, use NotEmpty or NotBlank for that.

    For interpolating the constraint violation message, the following parameters are available:

    • error - First error that occurred, such as a syntax error, with the message and position.
    • errorMessage - The message of the first error that occurred.
    • errorPosition - The position of the first error that occurred.
    Since:
    8.2.0
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      Class<?>[] groups  
      String message
      Gets the key for creating error messages in case the constraint is violated.
      Class<? extends javax.validation.Payload>[] payload  
    • Element Detail

      • groups

        Class<?>[] groups
        Returns:
        Allows the specification of validation groups, to which this constraint belongs. When not specified, the constraint is placed in the Default group.
        Default:
        {}
      • message

        String message
        Gets the key for creating error messages in case the constraint is violated.
        Returns:
        The default key for creating error messages in case the constraint is violated.
        Default:
        "{de.xima.fc.validation.constraints.ValidHtml.message}"
      • payload

        Class<? extends javax.validation.Payload>[] payload
        Returns:
        The payload that can be used by clients of the Jakarta Bean Validation API to assign custom payload objects to a constraint.
        Default:
        {}