@Documented @Retention(value=RUNTIME) @Target(value={TYPE_USE,TYPE_PARAMETER}) @SubtypeOf(value=I18nUnknownFormat.class) public @interface I18nFormatFor
MessageFormat.format(String, Object...)
, then the expression that
is an argument to the annotation can be passed as the remaining arguments, in varargs style.
The annotation is used to annotate a method to ensure that an argument is of a particular type indicated by a format string.
Example:
static void method(@I18nFormatFor("#2") String format, Object... arg2) {...} method("{0, number}", 2);This ensures that the second parameter ("#2") can be passed as the remaining arguments of
MessageFormat.format(String, Object...)
, when the first argument is "format"
.Modifier and Type | Required Element and Description |
---|---|
String |
value
Java expression that is an array that can be passed as the second argument to
MessageFormat.format(String, Object...) , when the annotated String is the first
argument. |
public abstract String value
MessageFormat.format(String, Object...)
, when the annotated String is the first
argument.