![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e110. Overriding Default AccessBy default, a reflected object enforces the access as defined by the Java language. For example, by default you cannot retrieve the value from aField object if the Field object represents a private
field. To bypass these access checks, you call setAccessible() on
the reflected object. However, the program may not have permission to
call setAccessible() , in which case SecurityException is thrown.
field.setAccessible(true); constructor.setAccessible(true); method.setAccessible(true);
e111. Creating a Proxy Object
© 2002 Addison-Wesley. |