org.python.core.Java2Accessibility Maven / Gradle / Ivy
Go to download
Jython is an implementation of the high-level, dynamic, object-oriented
language Python written in 100% Pure Java, and seamlessly integrated with
the Java platform. It thus allows you to run Python on any Java platform.
package org.python.core;
import java.lang.reflect.*;
/**
* Provides the Java 2 {Field|Method|Constructor}.setAccessibility() methods
* when compiled with, and running under Java 2.
*
* This class should not be compilied (and it won't compile) under Java 1.
*/
class Java2Accessibility extends JavaAccessibility {
void setAccess(Field field, boolean flag) throws SecurityException {
field.setAccessible(flag);
}
void setAccess(Method method, boolean flag) throws SecurityException {
method.setAccessible(flag);
}
void setAccess(Constructor constructor, boolean flag)
throws SecurityException {
constructor.setAccessible(flag);
}
}