src/share/native/java/lang/Class.c

Print this page


   1 /*
   2  * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  58     {"getInterfaces",    "()[" CLS,         (void *)&JVM_GetClassInterfaces},
  59     {"getClassLoader0",  "()" JCL,          (void *)&JVM_GetClassLoader},
  60     {"isInterface",      "()Z",             (void *)&JVM_IsInterface},
  61     {"getSigners",       "()[" OBJ,         (void *)&JVM_GetClassSigners},
  62     {"setSigners",       "([" OBJ ")V",     (void *)&JVM_SetClassSigners},
  63     {"isArray",          "()Z",             (void *)&JVM_IsArrayClass},
  64     {"isPrimitive",      "()Z",             (void *)&JVM_IsPrimitiveClass},
  65     {"getComponentType", "()" CLS,          (void *)&JVM_GetComponentType},
  66     {"getModifiers",     "()I",             (void *)&JVM_GetClassModifiers},
  67     {"getDeclaredFields0","(Z)[" FLD,       (void *)&JVM_GetClassDeclaredFields},
  68     {"getDeclaredMethods0","(Z)[" MHD,      (void *)&JVM_GetClassDeclaredMethods},
  69     {"getDeclaredConstructors0","(Z)[" CTR, (void *)&JVM_GetClassDeclaredConstructors},
  70     {"getProtectionDomain0", "()" PD,       (void *)&JVM_GetProtectionDomain},
  71     {"setProtectionDomain0", "(" PD ")V",   (void *)&JVM_SetProtectionDomain},
  72     {"getDeclaredClasses0",  "()[" CLS,      (void *)&JVM_GetDeclaredClasses},
  73     {"getDeclaringClass",   "()" CLS,      (void *)&JVM_GetDeclaringClass},
  74     {"getGenericSignature", "()" STR,       (void *)&JVM_GetClassSignature},
  75     {"getRawAnnotations",      "()" BA,        (void *)&JVM_GetClassAnnotations},
  76     {"getConstantPool",     "()" CPL,       (void *)&JVM_GetClassConstantPool},
  77     {"desiredAssertionStatus0","("CLS")Z",(void *)&JVM_DesiredAssertionStatus},
  78     {"getEnclosingMethod0", "()[" OBJ,      (void *)&JVM_GetEnclosingMethodInfo}

  79 };
  80 
  81 #undef OBJ
  82 #undef CLS
  83 #undef STR
  84 #undef JCL
  85 #undef FLD
  86 #undef MHD
  87 #undef CTR
  88 #undef PD
  89 
  90 JNIEXPORT void JNICALL
  91 Java_java_lang_Class_registerNatives(JNIEnv *env, jclass cls)
  92 {
  93     methods[1].fnPtr = (void *)(*env)->GetSuperclass;
  94     (*env)->RegisterNatives(env, cls, methods,
  95                             sizeof(methods)/sizeof(JNINativeMethod));
  96 }
  97 
  98 JNIEXPORT jclass JNICALL


   1 /*
   2  * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  58     {"getInterfaces",    "()[" CLS,         (void *)&JVM_GetClassInterfaces},
  59     {"getClassLoader0",  "()" JCL,          (void *)&JVM_GetClassLoader},
  60     {"isInterface",      "()Z",             (void *)&JVM_IsInterface},
  61     {"getSigners",       "()[" OBJ,         (void *)&JVM_GetClassSigners},
  62     {"setSigners",       "([" OBJ ")V",     (void *)&JVM_SetClassSigners},
  63     {"isArray",          "()Z",             (void *)&JVM_IsArrayClass},
  64     {"isPrimitive",      "()Z",             (void *)&JVM_IsPrimitiveClass},
  65     {"getComponentType", "()" CLS,          (void *)&JVM_GetComponentType},
  66     {"getModifiers",     "()I",             (void *)&JVM_GetClassModifiers},
  67     {"getDeclaredFields0","(Z)[" FLD,       (void *)&JVM_GetClassDeclaredFields},
  68     {"getDeclaredMethods0","(Z)[" MHD,      (void *)&JVM_GetClassDeclaredMethods},
  69     {"getDeclaredConstructors0","(Z)[" CTR, (void *)&JVM_GetClassDeclaredConstructors},
  70     {"getProtectionDomain0", "()" PD,       (void *)&JVM_GetProtectionDomain},
  71     {"setProtectionDomain0", "(" PD ")V",   (void *)&JVM_SetProtectionDomain},
  72     {"getDeclaredClasses0",  "()[" CLS,      (void *)&JVM_GetDeclaredClasses},
  73     {"getDeclaringClass",   "()" CLS,      (void *)&JVM_GetDeclaringClass},
  74     {"getGenericSignature", "()" STR,       (void *)&JVM_GetClassSignature},
  75     {"getRawAnnotations",      "()" BA,        (void *)&JVM_GetClassAnnotations},
  76     {"getConstantPool",     "()" CPL,       (void *)&JVM_GetClassConstantPool},
  77     {"desiredAssertionStatus0","("CLS")Z",(void *)&JVM_DesiredAssertionStatus},
  78     {"getEnclosingMethod0", "()[" OBJ,      (void *)&JVM_GetEnclosingMethodInfo},
  79     {"getRawTypeAnnotations", "()" BA,      (void *)&JVM_GetClassTypeAnnotations}
  80 };
  81 
  82 #undef OBJ
  83 #undef CLS
  84 #undef STR
  85 #undef JCL
  86 #undef FLD
  87 #undef MHD
  88 #undef CTR
  89 #undef PD
  90 
  91 JNIEXPORT void JNICALL
  92 Java_java_lang_Class_registerNatives(JNIEnv *env, jclass cls)
  93 {
  94     methods[1].fnPtr = (void *)(*env)->GetSuperclass;
  95     (*env)->RegisterNatives(env, cls, methods,
  96                             sizeof(methods)/sizeof(JNINativeMethod));
  97 }
  98 
  99 JNIEXPORT jclass JNICALL