home *** CD-ROM | disk | FTP | other *** search
- package java.lang;
-
- import java.io.InputStream;
- import java.io.Serializable;
- import java.lang.reflect.Constructor;
- import java.lang.reflect.Field;
- import java.lang.reflect.Method;
- import java.net.URL;
-
- public final class Class implements Serializable {
- private Class() {
- }
-
- public String toString() {
- return (this.isInterface() ? "interface " : (this.isPrimitive() ? "" : "class ")) + this.getName();
- }
-
- public static native Class forName(String var0) throws ClassNotFoundException;
-
- public native Object newInstance() throws InstantiationException, IllegalAccessException;
-
- public native boolean isInstance(Object var1);
-
- public native boolean isAssignableFrom(Class var1);
-
- public native boolean isInterface();
-
- public native boolean isArray();
-
- public native boolean isPrimitive();
-
- public native String getName();
-
- public native ClassLoader getClassLoader();
-
- public native Class getSuperclass();
-
- public native Class[] getInterfaces();
-
- public native Class getComponentType();
-
- public native int getModifiers();
-
- public native Object[] getSigners();
-
- native void setSigners(Object[] var1);
-
- public Class getDeclaringClass() {
- return null;
- }
-
- public Class[] getClasses() {
- return new Class[0];
- }
-
- public Field[] getFields() throws SecurityException {
- this.checkMemberAccess(0);
- return this.getFields0(0);
- }
-
- public Method[] getMethods() throws SecurityException {
- this.checkMemberAccess(0);
- return this.getMethods0(0);
- }
-
- public Constructor[] getConstructors() throws SecurityException {
- this.checkMemberAccess(0);
- return this.getConstructors0(0);
- }
-
- public Field getField(String var1) throws NoSuchFieldException, SecurityException {
- this.checkMemberAccess(0);
- return this.getField0(var1, 0);
- }
-
- public Method getMethod(String var1, Class[] var2) throws NoSuchMethodException, SecurityException {
- this.checkMemberAccess(0);
- return this.getMethod0(var1, var2, 0);
- }
-
- public Constructor getConstructor(Class[] var1) throws NoSuchMethodException, SecurityException {
- this.checkMemberAccess(0);
- return this.getConstructor0(var1, 0);
- }
-
- public Class[] getDeclaredClasses() throws SecurityException {
- this.checkMemberAccess(1);
- return new Class[0];
- }
-
- public Field[] getDeclaredFields() throws SecurityException {
- this.checkMemberAccess(1);
- return this.getFields0(1);
- }
-
- public Method[] getDeclaredMethods() throws SecurityException {
- this.checkMemberAccess(1);
- return this.getMethods0(1);
- }
-
- public Constructor[] getDeclaredConstructors() throws SecurityException {
- this.checkMemberAccess(1);
- return this.getConstructors0(1);
- }
-
- public Field getDeclaredField(String var1) throws NoSuchFieldException, SecurityException {
- this.checkMemberAccess(1);
- return this.getField0(var1, 1);
- }
-
- public Method getDeclaredMethod(String var1, Class[] var2) throws NoSuchMethodException, SecurityException {
- this.checkMemberAccess(1);
- return this.getMethod0(var1, var2, 1);
- }
-
- public Constructor getDeclaredConstructor(Class[] var1) throws NoSuchMethodException, SecurityException {
- this.checkMemberAccess(1);
- return this.getConstructor0(var1, 1);
- }
-
- public InputStream getResourceAsStream(String var1) {
- var1 = this.resolveName(var1);
- ClassLoader var2 = this.getClassLoader();
- return var2 == null ? ClassLoader.getSystemResourceAsStream(var1) : var2.getResourceAsStream(var1);
- }
-
- public URL getResource(String var1) {
- var1 = this.resolveName(var1);
- ClassLoader var2 = this.getClassLoader();
- return var2 == null ? ClassLoader.getSystemResource(var1) : var2.getResource(var1);
- }
-
- static native Class getPrimitiveClass(String var0);
-
- private void checkMemberAccess(int var1) {
- SecurityManager var2 = System.getSecurityManager();
- if (var2 != null) {
- var2.checkMemberAccess(this, var1);
- }
-
- }
-
- private String resolveName(String var1) {
- if (var1 == null) {
- return var1;
- } else {
- if (!var1.startsWith("/")) {
- Class var2;
- for(var2 = this; var2.isArray(); var2 = var2.getComponentType()) {
- }
-
- String var3 = var2.getName();
- int var4 = var3.lastIndexOf(46);
- if (var4 != -1) {
- var1 = var3.substring(0, var4).replace('.', '/') + "/" + var1;
- }
- } else {
- var1 = var1.substring(1);
- }
-
- return var1;
- }
- }
-
- private native Field[] getFields0(int var1);
-
- private native Method[] getMethods0(int var1);
-
- private native Constructor[] getConstructors0(int var1);
-
- private native Field getField0(String var1, int var2);
-
- private native Method getMethod0(String var1, Class[] var2, int var3);
-
- private native Constructor getConstructor0(Class[] var1, int var2);
- }
-