Member.java revision dd828f42a5c83b4270d4fbf6fce2da1878f1e84a
1/*
2 *  Licensed to the Apache Software Foundation (ASF) under one or more
3 *  contributor license agreements.  See the NOTICE file distributed with
4 *  this work for additional information regarding copyright ownership.
5 *  The ASF licenses this file to You under the Apache License, Version 2.0
6 *  (the "License"); you may not use this file except in compliance with
7 *  the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18package java.lang.reflect;
19
20/**
21 * Common interface providing access to reflective information on class members.
22 *
23 * @see Field
24 * @see Constructor
25 * @see Method
26 *
27 * @since Android 1.0
28 */
29public interface Member {
30
31    /**
32     * Designates all public members of a class or interface (including
33     * inherited members).
34     *
35     * @see java.lang.SecurityManager#checkMemberAccess
36     *
37     * @since Android 1.0
38     */
39    public static final int PUBLIC = 0;
40
41    /**
42     * Designates all declared members of a class or interface (without
43     * inherited members).
44     *
45     * @see java.lang.SecurityManager#checkMemberAccess
46     *
47     * @since Android 1.0
48     */
49    public static final int DECLARED = 1;
50
51    /**
52     * Returns the class that declares this member.
53     *
54     * @return the declaring class
55     *
56     * @since Android 1.0
57     */
58    @SuppressWarnings("unchecked")
59    Class getDeclaringClass();
60
61    /**
62     * Returns the modifiers for this member. The {@link Modifier} class should
63     * be used to decode the result.
64     *
65     * @return the modifiers for this member
66     *
67     * @see Modifier
68     *
69     * @since Android 1.0
70     */
71    int getModifiers();
72
73    /**
74     * Returns the name of this member.
75     *
76     * @return the name of this member
77     *
78     * @since Android 1.0
79     */
80    String getName();
81
82    /**
83     * Indicates whether or not this member is synthetic (artificially
84     * introduced by the compiler).
85     *
86     * @return {@code true} if this member is synthetic, {@code false} otherwise
87     *
88     * @since Android 1.0
89     */
90    boolean isSynthetic();
91}
92