1d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam/*
2d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * Copyright (C) 2011 The Android Open Source Project
3d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam *
4d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * Licensed under the Apache License, Version 2.0 (the "License");
5d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * you may not use this file except in compliance with the License.
6d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * You may obtain a copy of the License at
7d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam *
8d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam *      http://www.apache.org/licenses/LICENSE-2.0
9d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam *
10d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * Unless required by applicable law or agreed to in writing, software
11d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * distributed under the License is distributed on an "AS IS" BASIS,
12d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * See the License for the specific language governing permissions and
14d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * limitations under the License.
15d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam */
16d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam
178c10c403c063aff3f17c4949b0fe9a88536ae580Maurice Lampackage com.android.setupwizardlib.annotations;
18d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam
19d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lamimport java.lang.annotation.Retention;
20d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lamimport java.lang.annotation.RetentionPolicy;
21d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam
22d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam/**
23d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * Denotes that the class, method or field has its visibility relaxed so
24d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * that unit tests can access it.
25d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * <p/>
26d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * The <code>visibility</code> argument can be used to specific what the original
27d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * visibility should have been if it had not been made public or package-private for testing.
28d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam * The default is to consider the element private.
29d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam */
30d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam@Retention(RetentionPolicy.SOURCE)
31d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lampublic @interface VisibleForTesting {
32d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam    /**
33d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam     * Intended visibility if the element had not been made public or package-private for
34d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam     * testing.
35d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam     */
36d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam    enum Visibility {
37d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam        /** The element should be considered protected. */
38d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam        PROTECTED,
39d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam        /** The element should be considered package-private. */
40d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam        PACKAGE,
41d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam        /** The element should be considered private. */
42d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam        PRIVATE
43d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam    }
44d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam
45d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam    /**
46d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam     * Intended visibility if the element had not been made public or package-private for testing.
47d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam     * If not specified, one should assume the element originally intended to be private.
48d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam     */
49d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam    Visibility visibility() default Visibility.PRIVATE;
50d617ee5e12914b052682ee6f1bdf3ece28392f54Maurice Lam}