@Documented @Retention(value=RUNTIME) @Target(value={TYPE_USE,TYPE_PARAMETER}) @SubtypeOf(value=I18nUnknownFormat.class) public @interface I18nFormat
MessageFormat.format
.
The annotation's value represents the valid arguments that may be passed to the format method. For example:
@I18nFormat({I18nConversionCategory.GENERAL, I18nConversionCategory.NUMBER}) String f = "{0}{1, number}"; // valid String f = "{0} {1} {2}"; // error, the format string is stronger (more restrictive) than the specifiers. String 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
).I18nConversionCategory
Modifier and Type | Required Element and Description |
---|---|
I18nConversionCategory[] |
value
An array of
I18nConversionCategory , indicating the types of legal remaining arguments
when a value of the annotated type is used as the first argument to Message.format . |
public abstract I18nConversionCategory[] value
I18nConversionCategory
, indicating the types of legal remaining arguments
when a value of the annotated type is used as the first argument to Message.format
.