Søren Gjesse | 591455a | 2025-02-06 16:46:39 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2025 The Android Open Source Project |
| 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 | // *********************************************************************************** |
| 18 | // GENERATED FILE. DO NOT EDIT! See KeepItemAnnotationGenerator.java. |
| 19 | // *********************************************************************************** |
| 20 | |
| 21 | // *********************************************************************************** |
| 22 | // MAINTAINED AND TESTED IN THE R8 REPO. PLEASE MAKE CHANGES THERE AND REPLICATE. |
| 23 | // *********************************************************************************** |
| 24 | |
| 25 | package androidx.annotation.keep; |
| 26 | |
| 27 | import java.lang.annotation.ElementType; |
| 28 | import java.lang.annotation.Retention; |
| 29 | import java.lang.annotation.RetentionPolicy; |
| 30 | import java.lang.annotation.Target; |
| 31 | |
| 32 | /** |
| 33 | * A pattern structure for matching annotations. |
| 34 | * |
| 35 | * <p>If no properties are set, the default pattern matches any annotation with a runtime retention |
| 36 | * policy. |
| 37 | */ |
| 38 | @Target(ElementType.ANNOTATION_TYPE) |
| 39 | @Retention(RetentionPolicy.CLASS) |
| 40 | public @interface AnnotationPattern { |
| 41 | |
| 42 | /** |
| 43 | * Define the annotation-name pattern by fully qualified class name. |
| 44 | * |
| 45 | * <p>Mutually exclusive with the following other properties defining annotation-name: |
| 46 | * |
| 47 | * <ul> |
| 48 | * <li>constant |
| 49 | * <li>namePattern |
| 50 | * </ul> |
| 51 | * |
| 52 | * <p>If none are specified the default is to match any annotation name. |
| 53 | * |
| 54 | * @return The qualified class name that defines the annotation. |
| 55 | */ |
| 56 | String name() default ""; |
| 57 | |
| 58 | /** |
| 59 | * Define the annotation-name pattern by reference to a {@code Class} constant. |
| 60 | * |
| 61 | * <p>Mutually exclusive with the following other properties defining annotation-name: |
| 62 | * |
| 63 | * <ul> |
| 64 | * <li>name |
| 65 | * <li>namePattern |
| 66 | * </ul> |
| 67 | * |
| 68 | * <p>If none are specified the default is to match any annotation name. |
| 69 | * |
| 70 | * @return The Class constant that defines the annotation. |
| 71 | */ |
| 72 | Class<?> constant() default Object.class; |
| 73 | |
| 74 | /** |
| 75 | * Define the annotation-name pattern by reference to a class-name pattern. |
| 76 | * |
| 77 | * <p>Mutually exclusive with the following other properties defining annotation-name: |
| 78 | * |
| 79 | * <ul> |
| 80 | * <li>name |
| 81 | * <li>constant |
| 82 | * </ul> |
| 83 | * |
| 84 | * <p>If none are specified the default is to match any annotation name. |
| 85 | * |
| 86 | * @return The class-name pattern that defines the annotation. |
| 87 | */ |
| 88 | ClassNamePattern namePattern() default @ClassNamePattern(unqualifiedName = ""); |
| 89 | |
| 90 | /** |
| 91 | * Specify which retention policies must be set for the annotations. |
| 92 | * |
| 93 | * <p>Matches annotations with matching retention policies |
| 94 | * |
| 95 | * @return Retention policies. By default {@code RetentionPolicy.RUNTIME}. |
| 96 | */ |
| 97 | RetentionPolicy[] retention() default {RetentionPolicy.RUNTIME}; |
| 98 | } |