Annotation Type 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 Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Defines several NotEmptyLocalizationEntry constraints on the same element.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The message key for which the localized message should be non-empty.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
     
    Gets the key for creating error messages in case the constraint is violated.
    Class<? extends javax.validation.Payload>[]
     
    Optional.
  • 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 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 value entry#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:
      ""
    • 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.