|
|
|||||||||||||
Class ReflectionRequestpublic class ReflectionRequest implements ISecurityRequest { // Constructors public ReflectionRequest(int type, Class target); // Methods public PermissionID getPermissionID(); public String toString (); } This class represents a request to use the reflection APIs to gain access to members of a specified class. The type of access can be either to public members or to declared members of the class. ReflectionRequest objects should be used as the security request objects for parameterized security checks involving the reflection permission. The ReflectionPermission.check method expects a ReflectionRequest object as its parameter. Here is an example that shows how to use a ReflectionRequest object to perform a security check. ... // Create a ReflectionRequest object that indicates that you want to // access the public members of a specific class. Class cls = java.lang.String.class; ReflectionRequest sreq = new ReflectionRequest(Member.PUBLIC,cls); // Check to see that all of your callers have the rights to // access the public members of the class. PolicyEngine.checkPermission(sreq); ... For more information about checking reflection permissions, see the PolicyEngine class and the ReflectionPermission class. ConstructorsReflectionRequestpublic ReflectionRequest(int type, Class target); MethodsgetPermissionIDpublic PermissionID getPermissionID(); toStringpublic String toString ();
|
© 1998 Microsoft Corporation. All rights reserved. Terms of use. |