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); ...
public void setAllowedDeclaredAccess(int loadertypes);
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. |