Annotation Type NotEmptyLocalizationEntry
-
@Documented @Constraint(validatedBy=NotEmptyLocalizationEntryValidator.class) @Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE}) @Retention(RUNTIME) @Repeatable(List.class) public @interface NotEmptyLocalizationEntry
Constraint validation that may be applied to types that implementsILocalizationViewModelEntry
. Checks that themessages
have a non-empty value for the specifiedmessage key
.Does not check for null values, use
NotNull
for that.For interpolating the constraint violation message, the following parameters are available:
- languageTag - The language tag for which a message is missing.
- messageKey - The configured
message key
.
- Since:
- 8.2.0
-
-
Element Detail
-
value
String value
The message key for which the localized message should be non-empty.- Returns:
- The message key for which a message must exist.
-
-
-
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.NotEmptyLocalizationEntry.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:
- {}
-
-
-
property
String property
Optional. By default, the constraint violation is added to the path pointing to the map valueentry#getMessages
that contains the non-empty message. This property lets you change the path to some arbitrary property of the entry.May be useful when you use a custom
entry
implementation that has a virtual getter/setter method for getting/setting the value at a certain map key.A particular use case is when you use such a special bean property as a value expression to a Faces component on a facelet page. In combination with the
validateBean
tag, this lets it find the component from which to retrieve the label.- Returns:
- The name of the message key to use when adding the constraint violation.
- Default:
- ""
-
-