All Downloads are FREE. Search and download functionalities are using the official Maven repository.

checker.src.org.checkerframework.checker.i18nformatter.qual.I18nFormatFor Maven / Gradle / Ivy

Go to download

The Checker Framework enhances Java’s type system to make it more powerful and useful. This lets software developers detect and prevent errors in their Java programs. The Checker Framework includes compiler plug-ins ("checkers") that find bugs or verify their absence. It also permits you to write your own compiler plug-ins.

There is a newer version: 3.42.0
Show newest version
package org.checkerframework.checker.i18nformatter.qual;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.checkerframework.framework.qual.SubtypeOf;

/**
 * This annotation indicates that when a string of the annotated type is
 * passed as the first argument to {@link
 * 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 * {@link java.text.MessageFormat#format(String, Object...)}, * when the first argument is {@code "format"}. * * @checker_framework.manual #i18n-formatter-checker Internationalization * Format String Checker * @author Siwakorn Srisakaokul */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE_USE, ElementType.TYPE_PARAMETER }) @SubtypeOf(I18nUnknownFormat.class) public @interface I18nFormatFor { /** * Java expression that is an array that can be passed as the second * argument to {@link java.text.MessageFormat#format(String, Object...)}, * when the annotated String is the first argument. * @checker_framework.manual #java-expressions-as-arguments Syntax of Java expressions */ String value(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy