Annotation Type LocalizedProperty
@Target({ANNOTATION_TYPE,FIELD})
@Retention(RUNTIME)
@Repeatable(Container.class)
@Documented
public @interface LocalizedProperty
This annotation is used by
LocalizationUtils.localizeComponents(Component) to to
automatically localize properties of Components - like
HasText.setText(String) or TextField.setLabel(String) - stored in the fields of a
host object. It can be used on the fields directly or as meta-annotation on other annotations and
is repeatable.
- When
property()is empty, the properties to be localized will be determined from the local parts of themessages keysdeclared at the same location - i.e. on the same field directly or on the same annotation. In that casekey()also must be empty. - When a
property()is set, only the specified property will be localized - unless there are multipleLocalizedProperty.
- When used as meta-annotation, the host annotation may also provide a
property()orkey()attribute. If set they will override the respective value provided in theLocalizedProperty.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceContainer for repeated@LocalizedPropertyannotations. -
Optional Element Summary
Optional Elements
-
Element Details
-
property
String propertyThe name of the property to be translated.If empty/not specified, the properties to be localized will be determined from the local parts of
message keysdeclared at the same location (on the same field directly or on the same annotation). In that casekey()also must be empty.- Returns:
- the name of the property to be translated
- Default:
- ""
-
key
String keyThe (full) message key code used to translate the property. This can be set to reuse message keys that are already declared somewhere else. In that caseproperty()must also be set.- Returns:
- the (full) message key code used to translate the property
- Default:
- ""
-