This annotation, attached to a
String
type,
indicates that the String may be legally passed to
Formatter.format
, or
similar functions.
The annotation's value represents the valid parameters that may be passed to
the format function. For example:
@Format({ConversionCategory.GENERAL, ConversionCategory.INT})
String f = "String '%s' has length %d";
String.format(f, "Example", 7);
The annotation describes that the format string requires any Object as the
first parameter (
ConversionCategory.GENERAL
) and an integer as the
second parameter (
ConversionCategory.INT
).