2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * You may obtain a copy of the License at
6 * http://www.apache.org/licenses/LICENSE-2.0
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
20 #include "java/lang/Object.h"
34 using namespace reflect;
36 class Class : public Object {
39 static jmethodID *_mids;
40 static jclass initializeClass();
42 explicit Class(jobject obj) : Object(obj) {
45 Class(const Class& obj) : Object(obj) {}
47 static Class forName(const String& className);
48 JArray<Method> getDeclaredMethods() const;
49 JArray<Method> getMethods() const;
50 Method getMethod(const String &name, const JArray<Class>& params) const;
51 Method getDeclaredMethod(const String &name, const JArray<Class>& params) const;
52 JArray<Constructor> getDeclaredConstructors() const;
53 JArray<Field> getDeclaredFields() const;
54 JArray<Class> getDeclaredClasses() const;
56 int isPrimitive() const;
57 int isInterface() const;
58 int isAssignableFrom(const Class& obj) const;
59 Class getComponentType() const;
60 Class getSuperclass() const;
61 Class getDeclaringClass() const;
62 Class getEnclosingClass() const;
63 JArray<Class> getInterfaces() const;
64 String getName() const;
65 int getModifiers() const;
66 int isInstance(const Object &obj) const;
68 JArray<TypeVariable> getTypeParameters() const;
69 JArray<Type> getGenericInterfaces() const;
70 Type getGenericSuperclass() const;
74 extern PyTypeObject PY_TYPE(Class);
81 PyTypeObject *parameters[1];
82 static PyTypeObject **parameters_(t_Class *self)
84 return (PyTypeObject **) &(self->parameters);
87 static PyObject *wrap_Object(const Class& object);
89 static PyObject *wrap_Object(const Class& object, PyTypeObject *T);
91 static PyObject *wrap_jobject(const jobject& object);