OSDN Git Service

1c313b0af46669e253e29c29333e0793b8fc38a3
[pf3gnuchains/gcc-fork.git] / libjava / java / lang / reflect / Member.java
1 /* java.lang.reflect.Member - common query methods in reflection
2    Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
3
4 This file is part of GNU Classpath.
5
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING.  If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
20
21 As a special exception, if you link this library with other files to
22 produce an executable, this library does not by itself cause the
23 resulting executable to be covered by the GNU General Public License.
24 This exception does not however invalidate any other reasons why the
25 executable file might be covered by the GNU General Public License. */
26
27
28 package java.lang.reflect;
29
30 /**
31  * Member is an interface that represents any member of a class (field or
32  * method) or a constructor. You can get information about the declaring
33  * class, name or modifiers of the member with this interface.
34  *
35  * @author John Keiser
36  * @author Per Bothner <bothner@cygnus.com>
37  * @author Eric Blake <ebb9@email.byu.edu>
38  * @see Class
39  * @see Field
40  * @see Method
41  * @see Constructor
42  * @since 1.1
43  * @status updated to 1.4
44  */
45 public interface Member
46 {
47   /**
48    * Represents all members, whether public, private, protected or
49    * package-protected, but only which are declared in this class.
50    * Used in SecurityManager.checkMemberAccess() to determine the
51    * type of members to access.
52    * @see SecurityManager#checkMemberAccess()
53    */
54   int DECLARED = 1;
55
56   /**
57    * Represents public members only, but includes all inherited members.
58    *  Used in SecurityManager.checkMemberAccess() to determine the type of
59    * members to access.
60    * @see SecurityManager#checkMemberAccess()
61    */
62   int PUBLIC = 0;
63
64   /**
65    * Gets the class that declared this member. This is not the class where
66    * this method was called, or even the class where this Member object
67    * came to life, but the class that declares the member this represents.
68    *
69    * @return the class that declared this member
70    */
71   Class getDeclaringClass();
72
73   /**
74    * Gets the simple name of this member. This will be a valid Java
75    * identifier, with no qualification.
76    *
77    * @return the name of this member
78    */
79   String getName();
80
81   /**
82    * Gets the modifiers this member uses.  Use the <code>Modifier</code>
83    * class to interpret the values.
84    *
85    * @return an integer representing the modifiers to this Member
86    * @see Modifier
87    */
88   int getModifiers();
89 }