File tree Expand file tree Collapse file tree
common/src/main/java/org/intellij/lang/annotations Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 */
1616package org .intellij .lang .annotations ;
1717
18+ /**
19+ * Specifies that the method parameter is a printf-style print format pattern,
20+ * as described in {@link java.util.Formatter}.
21+ * <p>
22+ * Code editors that support {@link Pattern} annotation will check
23+ * the syntax of this value automatically. It could also be especially recognized to
24+ * check whether the subsequent var-arg arguments match the expected arguments
25+ * mentioned in the pattern. E. g., consider that the following method is annotated:
26+ * <pre><code>
27+ * void myprintf(@PrintFormat String format, Object... args) {...}
28+ * </code></pre>
29+ * <p>
30+ * In this case, code editors might recognize that the following call is erroneous,
31+ * and issue a warning:
32+ * <pre><code>
33+ * myprintf("%d\n", "hello"); // warning: a number expected instead of "hello"
34+ * </code></pre>
35+ *
36+ * @see Pattern
37+ */
1838@ Pattern (PrintFormatPattern .PRINT_FORMAT )
1939public @interface PrintFormat {
2040}
2141
22- // split up complex regex and workaround for IDEA-9173
2342class PrintFormatPattern {
2443
2544 // %[argument_index$][flags][width][.precision]conversion
You can’t perform that action at this time.
0 commit comments