Re: reflection

Jeff Nisewanger (Jeff.Nisewanger@eng.sun.com)
Tue, 1 Jun 1999 07:57:41 -0700 (PDT)

Message-Id: <199906011459.HAA23271@shorter.eng.sun.com>
Date: Tue, 1 Jun 1999 07:57:41 -0700 (PDT)
From: Jeff Nisewanger <Jeff.Nisewanger@eng.sun.com>
Subject: Re: reflection
To: java-security@java.sun.com, stephane.passignat@nsktechnologies.com

> How can I simply allow access to class' fields wich are not publics and
> not in the same class' package?
> How to manage java.lang.reflect.ReflectPermission?
>
> note : I've looked security chapter in the tutorial but I not familliar
> with Security.

If for some reason you need to bypass or ignore the usual Java
language public/protected/default/private access permissions you can do
this by calling the setAccessible() method on a Constructor, Field or
Method instance in the java.lang.reflect package. The reflection
objects inherit setAccessible() from the java.lang.reflect.AccessibleObject
class. You should read the api documentation for this class.
See http://java.sun.com/products/jdk/1.2/docs/guide/reflection/index.html
for more information.

Jeff