Annotation Type Messages


@Target({TYPE,FIELD,METHOD}) @Retention(RUNTIME) @Documented public @interface Messages
This annotation is used to declare message keys on types, fields or methods and can also be used as a meta-annotation.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Returns whether message keys for all bean properties of the annotated type should be created.
    boolean
    Returns whether a message key for the annotated type should be created.
    boolean
    Returns whether the annotated element should be ignored for the implicit generation of message keys.
    (Additional) Message keys.
    The prefix to be used for message keys.
    (Additional) Message keys.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Field Details

  • Element Details

    • forType

      boolean forType
      Returns whether a message key for the annotated type should be created. Only considered when the annotation is directly on the type.
      Returns:
      whether a message key for the annotated type should be created
      Default:
      false
    • forProperties

      boolean forProperties
      Returns whether message keys for all bean properties of the annotated type should be created. Only considered when the annotation is directly on the type.
      Returns:
      whether message keys for all bean properties of the annotated type should be created
      Default:
      false
    • ignoreImplicit

      boolean ignoreImplicit
      Returns whether the annotated element should be ignored for the implicit generation of message keys. E.g. properties (represented by the associated getter) and enum elements annotated with ignoreImplicit = true will be ignored. However, explicitly provided message keys on that element will still be processed!
      Returns:
      whether the annotated element should be ignored for the implicit generation of message keys
      Default:
      false
    • prefix

      String prefix
      The prefix to be used for message keys. The default is to use the fully qualified name of the source type followed by a period (.). The prefix should usually not be changed, but sometimes it may be necessary to declare very specific message keys. The prefix can only be set at the type level.
      Returns:
      prefix to be used for message keys
      Default:
      "__SOURCE_TYPE__"
    • value

      String[] value
      (Additional) Message keys. The provided strings will be used as local parts in the full message keys. This is an alias for keys().
      Returns:
      message keys
      Default:
      {}
    • keys

      String[] keys
      (Additional) Message keys. The provided strings will be used as local parts in the full message keys. This is an alias for value().
      Returns:
      message keys
      Default:
      {}