blob: 7b9a507ee45d011ea3d4cc7544dbdccbb17757c4 [file] [log] [blame]
Ashley Rose041d90b2018-11-07 17:35:19 -05001/*
2 * Copyright 2018 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
17package android.view.inspector;
18
19import static java.lang.annotation.ElementType.TYPE;
20import static java.lang.annotation.RetentionPolicy.SOURCE;
21
Ashley Rosec1a4dec2018-12-13 18:06:30 -050022import android.annotation.TestApi;
23
Ashley Rose041d90b2018-11-07 17:35:19 -050024import java.lang.annotation.Retention;
25import java.lang.annotation.Target;
26
27/**
28 * Marks the node name to display to a developer in the inspection tree.
29 *
30 * This annotation is optional to marking a class as inspectable. If it is omitted, the node name
31 * will be inferred using the semantics of {@link Class#getSimpleName()}. The fully qualified class
32 * name is always available in the tree, this is for display purposes only. If a class is inflated
33 * from XML and the tag it inflates from does not match its simple name, this annotation should be
34 * used to inform the inspector to display the XML tag name in the inspection tree view.
35 *
36 * This annotation does not inherit. If a class extends an annotated parent class, but does not
37 * annotate itself, its node name will be inferred from its Java name.
38 *
Ashley Rosed2c5f452018-11-29 15:40:10 -050039 * @see InspectionCompanion#getNodeName()
Ashley Rose041d90b2018-11-07 17:35:19 -050040 * @hide
41 */
42@Target({TYPE})
43@Retention(SOURCE)
Ashley Rosec1a4dec2018-12-13 18:06:30 -050044@TestApi
Ashley Rose041d90b2018-11-07 17:35:19 -050045public @interface InspectableNodeName {
46 /**
47 * The display name for nodes of this type.
48 *
49 * @return The name for nodes of this type
50 */
51 String value();
52}