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

public @Interface I18nFormat

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, 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
I18nConversionCategory

Method Summary

Modifier and TypeMethod and Description
public 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.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public 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.