Annotation Type NotEmptyHtmlTextContent
@Documented
@Constraint(validatedBy=NotEmptyHtmlTextContentValidator.class)
@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
@Retention(RUNTIME)
@Repeatable(NotEmptyHtmlTextContent.List.class)
public @interface NotEmptyHtmlTextContent
Constraint validation annotation that may be applied to
Strings. Checks that the string, if it represents
valid HTML, represents an HTML fragment whose text content is not empty.
Does not check for null values, use NotNull for that.
Does not check for empty or blank values, use NotEmpty or
NotBlank for that.
Does not check for invalid HTML, use ValidHtml for that.
- Since:
- 8.2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceDefines severalNotEmptyHtmlTextContentconstraints on the same element. -
Optional Element Summary
Optional Elements
-
Element Details
-
groups
Class<?>[] groups- Returns:
- Allows the specification of validation groups, to which this constraint belongs. When not specified, the
constraint is placed in the
Defaultgroup.
- Default:
{}
-
message
String messageGets 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.NotEmptyHtmlTextContent.message}"
-
normalize
boolean normalizeWhether to normalize the text content. When enabled: whitespace is normalized and trimmed.- Returns:
- Whether to normalize the text content.
- Default:
true
-
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:
{}
-