KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > python > core > Java2Accessibility


1 package org.python.core;
2 import java.lang.reflect.*;
3
4 /**
5  * Provides the Java 2 {Field|Method|Constructor}.setAccessibility()
6  * methods when compiled with, and running under Java 2.
7  *
8  * This class should not be compilied (and it won't compile) under Java 1.
9  */

10
11 class Java2Accessibility extends JavaAccessibility
12 {
13     void setAccess(Field field, boolean flag) throws SecurityException JavaDoc {
14         field.setAccessible(flag);
15     }
16
17     void setAccess(Method method, boolean flag) throws SecurityException JavaDoc {
18         method.setAccessible(flag);
19     }
20
21     void setAccess(Constructor constructor, boolean flag)
22         throws SecurityException JavaDoc
23     {
24         constructor.setAccessible(flag);
25     }
26 }
27
Popular Tags