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