001/* java.lang.reflect.Member - common query methods in reflection 002 Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc. 003 004This file is part of GNU Classpath. 005 006GNU Classpath is free software; you can redistribute it and/or modify 007it under the terms of the GNU General Public License as published by 008the Free Software Foundation; either version 2, or (at your option) 009any later version. 010 011GNU Classpath is distributed in the hope that it will be useful, but 012WITHOUT ANY WARRANTY; without even the implied warranty of 013MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014General Public License for more details. 015 016You should have received a copy of the GNU General Public License 017along with GNU Classpath; see the file COPYING. If not, write to the 018Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 01902110-1301 USA. 020 021Linking this library statically or dynamically with other modules is 022making a combined work based on this library. Thus, the terms and 023conditions of the GNU General Public License cover the whole 024combination. 025 026As a special exception, the copyright holders of this library give you 027permission to link this library with independent modules to produce an 028executable, regardless of the license terms of these independent 029modules, and to copy and distribute the resulting executable under 030terms of your choice, provided that you also meet, for each linked 031independent module, the terms and conditions of the license of that 032module. An independent module is a module which is not derived from 033or based on this library. If you modify this library, you may extend 034this exception to your version of the library, but you are not 035obligated to do so. If you do not wish to do so, delete this 036exception statement from your version. */ 037 038 039package java.lang.reflect; 040 041/** 042 * Member is an interface that represents any member of a class (field or 043 * method) or a constructor. You can get information about the declaring 044 * class, name or modifiers of the member with this interface. 045 * 046 * @author John Keiser 047 * @author Per Bothner (bothner@cygnus.com) 048 * @author Eric Blake (ebb9@email.byu.edu) 049 * @see Class 050 * @see Field 051 * @see Method 052 * @see Constructor 053 * @since 1.1 054 * @status updated to 1.4 055 */ 056public interface Member 057{ 058 /** 059 * Represents all members, whether public, private, protected or 060 * package-protected, but only which are declared in this class. 061 * Used in SecurityManager.checkMemberAccess() to determine the 062 * type of members to access. 063 * @see SecurityManager#checkMemberAccess(Class, int) 064 */ 065 int DECLARED = 1; 066 067 /** 068 * Represents public members only, but includes all inherited members. 069 * Used in SecurityManager.checkMemberAccess() to determine the type of 070 * members to access. 071 * @see SecurityManager#checkMemberAccess(Class, int) 072 */ 073 int PUBLIC = 0; 074 075 /** 076 * Gets the class that declared this member. This is not the class where 077 * this method was called, or even the class where this Member object 078 * came to life, but the class that declares the member this represents. 079 * 080 * @return the class that declared this member 081 */ 082 Class getDeclaringClass(); 083 084 /** 085 * Gets the simple name of this member. This will be a valid Java 086 * identifier, with no qualification. 087 * 088 * @return the name of this member 089 */ 090 String getName(); 091 092 /** 093 * Gets the modifiers this member uses. Use the <code>Modifier</code> 094 * class to interpret the values. 095 * 096 * @return an integer representing the modifiers to this Member 097 * @see Modifier 098 */ 099 int getModifiers(); 100 101 /** 102 * Return true if this member is synthetic, meaning that it was 103 * created by the compiler and does not appear in the user's 104 * source code. 105 * @return true if the member is synthetic 106 * @since 1.5 107 */ 108 boolean isSynthetic(); 109}