Debian Codegraph @

src/com/google/errorprone/annotations/FormatString.java

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
•1 /*
2 * Copyright 2016 The Error Prone Authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package com.google.errorprone.annotations;
18
19 import static java.lang.annotation.RetentionPolicy.CLASS;
20
21 import java.lang.annotation.Documented;
22 import java.lang.annotation.ElementType;
23 import java.lang.annotation.Retention;
24 import java.lang.annotation.Target;
25
26 /**
27 * Annotation for method parameter declarations which denotes that actual parameters will be used as
28 * a format string in printf-style formatting.
29 *
30 * <p>This is an optional annotation used along with the {@link FormatMethod} annotation to denote
31 * which parameter in a format method is the format string. All parameters after the format string
32 * are assumed to be printf-style arguments for the format string. For example, the following
33 * snippet declares that {@code logMessage} will be used as a format string with {@code args} passed
34 * as arguments to the format string:
35 *
36 * <pre>
37 * public class Foo {
38 * &#064;FormatMethod void doBarAndLogFailure(&#064;FormatString String logMessage,
39 * Object... args) {...}
40 * }</pre>
41 *
42 * <p>See {@link FormatMethod} for more information.
43 */
44 @Documented
45 @Retention(CLASS)
46 @Target({ElementType.PARAMETER})
47 public @interface FormatString {}