Microsoft SDK for Java

setAllowedDeclaredAccess

This method of the ReflectionPermission Class sets the types of classes that the permission object allows declared reflective access to. The classes are specified by the loader types. For example, the following code indicates that the permission should only allow declared reflective access to classes from the same loader:

    ...
    ReflectionPermission perm = new ReflectionPermission();
    perm.setAssociatedLoader( some loader );
    perm.setAllowedDeclaredAccess(ReflectionPermission.SAMELOADER);
    ...

Syntax

public void setAllowedDeclaredAccess(int loadertypes);

Parameters

loadertypes The types of classes that the permission object will allow declared reflective access to. This should be one of the following types: SAMELOADER, DIFFERENTLOADER, SYSTEMLOADER, ALL, or NONE.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.