Top Description Methods
org.checkerframework.checker.i18nformatter.qual

public @Interface I18nFormatFor

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:TYPE_USE, TYPE_PARAMETER
@SubtypeOf:I18nUnknownFormat
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target, org.checkerframework.framework.qual.SubtypeOf

This annotation indicates that when a string of the annotated type is passed as the first argument to java.text.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 java.text.MessageFormat#format(String, Object...), when the first argument is "format".

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

# followed by the 1-based index of the formal parameter that is the arguments to the format method
value
()

Indicates which formal parameter is the arguments to the format method.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public String value()

Indicates which formal parameter is the arguments to the format method. The value should be # followed by the 1-based index of the formal parameter that is the arguments to the format method, e.g., "#2".

Returns:String

# followed by the 1-based index of the formal parameter that is the arguments to the format method