Annotation Interface I18nFormat


This annotation, attached to a String type, indicates that the String may be passed to MessageFormat.format.

The annotation's value represents the valid arguments that may be passed to the format method. For example:

@I18nFormat({GENERAL, NUMBER}) String f;

 f = "{0}{1, number}"; // valid
 f = "{0} {1} {2}"; // error, the format string is stronger (more restrictive) than the specifiers.
 f = "{0, number} {1, number}"; // error, the format string is stronger (NUMBER is a subtype of GENERAL).
 
The annotation indicates that the format string requires any object as the first parameter (I18nConversionCategory.GENERAL) and a number as the second parameter (I18nConversionCategory.NUMBER).
See Also:
See the Checker Framework Manual:
Internationalization Format String Checker