@Target({TYPE,METHOD})
@Retention(RUNTIME)
@Repeatable(Container.class)
@Documented
public @interface MessagesFor
This annotation is used to declare message keys for types that cannot be annotated directly. This
means
@MessagesFor(type=SomeType.class, ...) is equivalent to annotating SomeType
directly using @Messages(...).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceContainer for repeated@MessagesForannotations. -
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanReturns whether message keys for all bean properties of the annotated type should be created.booleanReturns whether a message key for the annotated type should be created.String[]Returns a list of message keys that should be ignored for message key creation, like specfic bean properties or enum elements.String[](Additional) Message keys.The prefix to be used for message keys.String[](Additional) Message keys.
-
Element Details
-
-
forType
boolean forTypeReturns whether a message key for the annotated type should be created. Only relevant when the annotation is directly on the type.- Returns:
- whether a message key for the annotated type should be created
- Default:
- false
-
forProperties
boolean forPropertiesReturns whether message keys for all bean properties of the annotated type should be created. Only relevant on classes.- Returns:
- whether message keys for all bean properties of the annotated type should be created
- Default:
- false
-
ignoreImplicitKeys
String[] ignoreImplicitKeysReturns a list of message keys that should be ignored for message key creation, like specfic bean properties or enum elements.- Returns:
- whether the annotated element should be ignored for the implicit generation of message keys
- Default:
- {}
-
prefix
String prefixThe prefix to be used for message keys. This can only be set if this annotation is at the type level. If not set, the fully qualified name of the source type is used.- 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 message keys. This is an alias forkeys().- Returns:
- message keys
- Default:
- {}
-
keys
String[] keys(Additional) Message keys. The provided strings will be used as local parts in the message keys. This is an alias forvalue().- Returns:
- message keys
- Default:
- {}
-