Annotation Type NotEmptyLocalizationEntry
@Documented
@Constraint(validatedBy=NotEmptyLocalizationEntryValidator.class)
@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
@Retention(RUNTIME)
@Repeatable(NotEmptyLocalizationEntry.List.class)
public @interface NotEmptyLocalizationEntry
Constraint validation that may be applied to types that implements
ILocalizationViewModelEntry. Checks that
the messages have a non-empty value for the specified
message 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceDefines severalNotEmptyLocalizationEntryconstraints on the same element. -
Required Element Summary
Required Elements -
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.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 propertyOptional. By default, the constraint violation is added to the path pointing to the map valueentry#getMessagesthat 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
entryimplementation 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
validateBeantag, 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:
""
-
value
String valueThe message key for which the localized message should be non-empty.- Returns:
- The message key for which a message must exist.
-