Member.java 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /* java.lang.reflect.Member - common query methods in reflection
  2. Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. 02110-1301 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package java.lang.reflect;
  32. /**
  33. * Member is an interface that represents any member of a class (field or
  34. * method) or a constructor. You can get information about the declaring
  35. * class, name or modifiers of the member with this interface.
  36. *
  37. * @author John Keiser
  38. * @author Per Bothner (bothner@cygnus.com)
  39. * @author Eric Blake (ebb9@email.byu.edu)
  40. * @see Class
  41. * @see Field
  42. * @see Method
  43. * @see Constructor
  44. * @since 1.1
  45. * @status updated to 1.4
  46. */
  47. public interface Member
  48. {
  49. /**
  50. * Represents all members, whether public, private, protected or
  51. * package-protected, but only which are declared in this class.
  52. * Used in SecurityManager.checkMemberAccess() to determine the
  53. * type of members to access.
  54. * @see SecurityManager#checkMemberAccess(Class, int)
  55. */
  56. int DECLARED = 1;
  57. /**
  58. * Represents public members only, but includes all inherited members.
  59. * Used in SecurityManager.checkMemberAccess() to determine the type of
  60. * members to access.
  61. * @see SecurityManager#checkMemberAccess(Class, int)
  62. */
  63. int PUBLIC = 0;
  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. * Gets the simple name of this member. This will be a valid Java
  74. * identifier, with no qualification.
  75. *
  76. * @return the name of this member
  77. */
  78. String getName();
  79. /**
  80. * Gets the modifiers this member uses. Use the <code>Modifier</code>
  81. * class to interpret the values.
  82. *
  83. * @return an integer representing the modifiers to this Member
  84. * @see Modifier
  85. */
  86. int getModifiers();
  87. /**
  88. * Return true if this member is synthetic, meaning that it was
  89. * created by the compiler and does not appear in the user's
  90. * source code.
  91. * @return true if the member is synthetic
  92. * @since 1.5
  93. */
  94. boolean isSynthetic();
  95. }