1. /*
  2. * @(#)ReflectPermission.java 1.14 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.lang.reflect;
  11. /**
  12. * The Permission class for reflective operations. A
  13. * ReflectPermission is a <em>named permission</em> and has no
  14. * actions. The only name currently defined is <tt>suppressAccessChecks</tt>,
  15. * which allows suppressing the standard Java language access checks
  16. * -- for public, default (package) access, protected, and private
  17. * members -- performed by reflected objects at their point of use.
  18. * <P>
  19. * The following table
  20. * provides a summary description of what the permission allows,
  21. * and discusses the risks of granting code the permission.
  22. * <P>
  23. *
  24. * <table border=1 cellpadding=5>
  25. * <tr>
  26. * <th>Permission Target Name</th>
  27. * <th>What the Permission Allows</th>
  28. * <th>Risks of Allowing this Permission</th>
  29. * </tr>
  30. *
  31. * <tr>
  32. * <td>suppressAccessChecks</td>
  33. * <td>ability to access
  34. * fields and invoke methods in a class. Note that this includes
  35. * not only public, but protected and private fields and methods as well.</td>
  36. * <td>This is dangerous in that information (possibly confidential) and
  37. * methods normally unavailable would be accessible to malicious code.</td>
  38. * </tr>
  39. *
  40. * </table>
  41. *
  42. * @see java.security.Permission
  43. * @see java.security.BasicPermission
  44. * @see AccessibleObject
  45. * @see Field#get
  46. * @see Field#set
  47. * @see Method#invoke
  48. * @see Constructor#newInstance
  49. *
  50. * @since 1.2
  51. */
  52. public final
  53. class ReflectPermission extends java.security.BasicPermission {
  54. /**
  55. * Constructs a ReflectPermission with the specified name.
  56. *
  57. * @param name the name of the ReflectPermission
  58. */
  59. public ReflectPermission(String name) {
  60. super(name);
  61. }
  62. /**
  63. * Constructs a ReflectPermission with the specified name and actions.
  64. * The actions should be null; they are ignored. This
  65. * constructor exists for use by the <code>Policy</code> object
  66. * to instantiate new Permission objects.
  67. *
  68. * @param name the name of the ReflectPermission
  69. * @param actions should be null.
  70. */
  71. public ReflectPermission(String name, String actions) {
  72. super(name, actions);
  73. }
  74. }