01: package org.python.core;
02:
03: import java.lang.reflect.*;
04:
05: /**
06: * Provides the Java 2 {Field|Method|Constructor}.setAccessibility() methods
07: * when compiled with, and running under Java 2.
08: *
09: * This class should not be compilied (and it won't compile) under Java 1.
10: */
11:
12: class Java2Accessibility extends JavaAccessibility {
13: void setAccess(Field field, boolean flag) throws SecurityException {
14: field.setAccessible(flag);
15: }
16:
17: void setAccess(Method method, boolean flag)
18: throws SecurityException {
19: method.setAccessible(flag);
20: }
21:
22: void setAccess(Constructor constructor, boolean flag)
23: throws SecurityException {
24: constructor.setAccessible(flag);
25: }
26: }
|