Home | History | Annotate | Download | only in reflect
      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 
     18 package 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 public interface Member {
     28 
     29     /**
     30      * Designates all public members of a class or interface (including
     31      * inherited members).
     32      */
     33     public static final int PUBLIC = 0;
     34 
     35     /**
     36      * Designates all declared members of a class or interface (without
     37      * inherited members).
     38      */
     39     public static final int DECLARED = 1;
     40 
     41     /**
     42      * Returns the class that declares this member.
     43      *
     44      * @return the declaring class
     45      */
     46     @SuppressWarnings("unchecked")
     47     Class<?> getDeclaringClass();
     48 
     49     /**
     50      * Returns the modifiers for this member. The {@link Modifier} class should
     51      * be used to decode the result.
     52      *
     53      * @return the modifiers for this member
     54      *
     55      * @see Modifier
     56      */
     57     int getModifiers();
     58 
     59     /**
     60      * Returns the name of this member.
     61      *
     62      * @return the name of this member
     63      */
     64     String getName();
     65 
     66     /**
     67      * Indicates whether or not this member is synthetic (artificially
     68      * introduced by the compiler).
     69      *
     70      * @return {@code true} if this member is synthetic, {@code false} otherwise
     71      */
     72     boolean isSynthetic();
     73 }
     74