Configured build for Ubuntu and added Stempel polish analyzer
[pylucene.git] / jcc / _jcc / java / lang / reflect / GenericDeclaration.cpp
1 #ifdef _java_generics
2
3 #include <jni.h>
4 #include "JCCEnv.h"
5 #include "java/lang/reflect/GenericDeclaration.h"
6 #include "java/lang/Class.h"
7 #include "java/lang/reflect/TypeVariable.h"
8 #include "JArray.h"
9
10 namespace java {
11     namespace lang {
12         namespace reflect {
13
14             java::lang::Class *GenericDeclaration::class$ = NULL;
15             jmethodID *GenericDeclaration::mids$ = NULL;
16
17             jclass GenericDeclaration::initializeClass()
18             {
19                 if (!class$)
20                 {
21
22                     jclass cls = (jclass) env->findClass("java/lang/reflect/GenericDeclaration");
23
24                     mids$ = new jmethodID[max_mid];
25                     mids$[mid_getTypeParameters_837d3468] = env->getMethodID(cls, "getTypeParameters", "()[Ljava/lang/reflect/TypeVariable;");
26
27                     class$ = (java::lang::Class *) new JObject(cls);
28                 }
29                 return (jclass) class$->this$;
30             }
31
32             JArray<java::lang::reflect::TypeVariable> GenericDeclaration::getTypeParameters() const
33             {
34                 return JArray<java::lang::reflect::TypeVariable>(env->callObjectMethod(this$, mids$[mid_getTypeParameters_837d3468]));
35             }
36         }
37     }
38 }
39
40 #include "structmember.h"
41 #include "functions.h"
42 #include "macros.h"
43
44 namespace java {
45     namespace lang {
46         namespace reflect {
47             static PyObject *t_GenericDeclaration_cast_(PyTypeObject *type, PyObject *arg);
48             static PyObject *t_GenericDeclaration_instance_(PyTypeObject *type, PyObject *arg);
49             static PyObject *t_GenericDeclaration_getTypeParameters(t_GenericDeclaration *self);
50
51             static PyMethodDef t_GenericDeclaration__methods_[] = {
52                 DECLARE_METHOD(t_GenericDeclaration, cast_, METH_O | METH_CLASS),
53                 DECLARE_METHOD(t_GenericDeclaration, instance_, METH_O | METH_CLASS),
54                 DECLARE_METHOD(t_GenericDeclaration, getTypeParameters, METH_NOARGS),
55                 { NULL, NULL, 0, NULL }
56             };
57
58             DECLARE_TYPE(GenericDeclaration, t_GenericDeclaration, java::lang::Object, GenericDeclaration, abstract_init, 0, 0, 0, 0, 0);
59
60             static PyObject *t_GenericDeclaration_cast_(PyTypeObject *type, PyObject *arg)
61             {
62                 if (!(arg = castCheck(arg, GenericDeclaration::initializeClass, 1)))
63                     return NULL;
64                 return t_GenericDeclaration::wrap_Object(GenericDeclaration(((t_GenericDeclaration *) arg)->object.this$));
65             }
66             static PyObject *t_GenericDeclaration_instance_(PyTypeObject *type, PyObject *arg)
67             {
68                 if (!castCheck(arg, GenericDeclaration::initializeClass, 0))
69                     Py_RETURN_FALSE;
70                 Py_RETURN_TRUE;
71             }
72
73             static PyObject *t_GenericDeclaration_getTypeParameters(t_GenericDeclaration *self)
74             {
75                 JArray<TypeVariable> result((jobject) NULL);
76                 OBJ_CALL(result = self->object.getTypeParameters());
77
78                 return result.toSequence(t_TypeVariable::wrap_Object);
79             }
80         }
81     }
82 }
83
84 #endif /* _java_generics */