You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by va...@apache.org on 2009/01/09 04:28:41 UTC
svn commit: r732916 [3/14] - in /lucene/pylucene/trunk: ./ java/ java/org/
java/org/osafoundation/ java/org/osafoundation/lucene/
java/org/osafoundation/lucene/analysis/
java/org/osafoundation/lucene/queryParser/
java/org/osafoundation/lucene/search/ j...
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Class.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Class.cpp?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Class.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Class.cpp Thu Jan 8 19:28:33 2009
@@ -0,0 +1,462 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+
+#include "JArray.h"
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/String.h"
+#include "java/lang/reflect/Method.h"
+#include "java/lang/reflect/Constructor.h"
+#include "java/lang/reflect/Field.h"
+
+namespace java {
+ namespace lang {
+ using namespace reflect;
+
+ enum {
+ mid_forName,
+ mid_getDeclaredMethods,
+ mid_getMethods,
+ mid_getMethod,
+ mid_getDeclaredMethod,
+ mid_getDeclaredConstructors,
+ mid_getDeclaredFields,
+ mid_getDeclaredClasses,
+ mid_isArray,
+ mid_isPrimitive,
+ mid_isInterface,
+ mid_isAssignableFrom,
+ mid_getComponentType,
+ mid_getSuperclass,
+ mid_getInterfaces,
+ mid_getName,
+ mid_getModifiers,
+ mid_isInstance,
+ max_mid
+ };
+
+ Class *Class::class$ = NULL;
+ jmethodID *Class::_mids = NULL;
+
+ jclass Class::initializeClass()
+ {
+ if (!class$)
+ {
+ jclass cls = env->findClass("java/lang/Class");
+
+ _mids = new jmethodID[max_mid];
+ _mids[mid_forName] =
+ env->getStaticMethodID(cls, "forName",
+ "(Ljava/lang/String;)Ljava/lang/Class;");
+ _mids[mid_getDeclaredMethods] =
+ env->getMethodID(cls, "getDeclaredMethods",
+ "()[Ljava/lang/reflect/Method;");
+ _mids[mid_getMethods] =
+ env->getMethodID(cls, "getMethods",
+ "()[Ljava/lang/reflect/Method;");
+ _mids[mid_getMethod] =
+ env->getMethodID(cls, "getMethod",
+ "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;");
+ _mids[mid_getDeclaredMethod] =
+ env->getMethodID(cls, "getDeclaredMethod",
+ "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;");
+ _mids[mid_getDeclaredConstructors] =
+ env->getMethodID(cls, "getDeclaredConstructors",
+ "()[Ljava/lang/reflect/Constructor;");
+ _mids[mid_getDeclaredFields] =
+ env->getMethodID(cls, "getDeclaredFields",
+ "()[Ljava/lang/reflect/Field;");
+ _mids[mid_getDeclaredClasses] =
+ env->getMethodID(cls, "getDeclaredClasses",
+ "()[Ljava/lang/Class;");
+ _mids[mid_isArray] =
+ env->getMethodID(cls, "isArray",
+ "()Z");
+ _mids[mid_isPrimitive] =
+ env->getMethodID(cls, "isPrimitive",
+ "()Z");
+ _mids[mid_isInterface] =
+ env->getMethodID(cls, "isInterface",
+ "()Z");
+ _mids[mid_isAssignableFrom] =
+ env->getMethodID(cls, "isAssignableFrom",
+ "(Ljava/lang/Class;)Z");
+ _mids[mid_getComponentType] =
+ env->getMethodID(cls, "getComponentType",
+ "()Ljava/lang/Class;");
+ _mids[mid_getSuperclass] =
+ env->getMethodID(cls, "getSuperclass",
+ "()Ljava/lang/Class;");
+ _mids[mid_getInterfaces] =
+ env->getMethodID(cls, "getInterfaces",
+ "()[Ljava/lang/Class;");
+ _mids[mid_getName] =
+ env->getMethodID(cls, "getName",
+ "()Ljava/lang/String;");
+ _mids[mid_getModifiers] =
+ env->getMethodID(cls, "getModifiers",
+ "()I");
+ _mids[mid_isInstance] =
+ env->getMethodID(cls, "isInstance",
+ "(Ljava/lang/Object;)Z");
+
+ class$ = (Class *) new JObject(cls);
+ }
+
+ return (jclass) class$->this$;
+ }
+
+
+ Class Class::forName(const String& className)
+ {
+ jclass cls = initializeClass();
+ jobject obj = env->callStaticObjectMethod(cls, _mids[mid_forName], className.this$);
+
+ return Class((jclass) obj);
+ }
+
+ JArray<Method> Class::getDeclaredMethods() const
+ {
+ jobjectArray array = (jobjectArray)
+ env->callObjectMethod(this$, _mids[mid_getDeclaredMethods]);
+
+ return JArray<Method>(array);
+ }
+
+ JArray<Method> Class::getMethods() const
+ {
+ jobjectArray array = (jobjectArray)
+ env->callObjectMethod(this$, _mids[mid_getMethods]);
+
+ return JArray<Method>(array);
+ }
+
+ Method Class::getMethod(const String& name, const JArray<Class>& params) const
+ {
+ return Method(env->callObjectMethod(this$, _mids[mid_getMethod], name.this$, params.this$));
+ }
+
+ Method Class::getDeclaredMethod(const String& name, const JArray<Class>& params) const
+ {
+ return Method(env->callObjectMethod(this$, _mids[mid_getDeclaredMethod], name.this$, params.this$));
+ }
+
+ JArray<Constructor> Class::getDeclaredConstructors() const
+ {
+ jobjectArray array = (jobjectArray)
+ env->callObjectMethod(this$, _mids[mid_getDeclaredConstructors]);
+
+ return JArray<Constructor>(array);
+ }
+
+ JArray<Field> Class::getDeclaredFields() const
+ {
+ jobjectArray array = (jobjectArray)
+ env->callObjectMethod(this$, _mids[mid_getDeclaredFields]);
+
+ return JArray<Field>(array);
+ }
+
+ JArray<Class> Class::getDeclaredClasses() const
+ {
+ jobjectArray array = (jobjectArray)
+ env->callObjectMethod(this$, _mids[mid_getDeclaredClasses]);
+
+ return JArray<Class>(array);
+ }
+
+ int Class::isArray() const
+ {
+ return (int) env->callBooleanMethod(this$, _mids[mid_isArray]);
+ }
+
+ int Class::isPrimitive() const
+ {
+ return (int) env->callBooleanMethod(this$, _mids[mid_isPrimitive]);
+ }
+
+ int Class::isInterface() const
+ {
+ return (int) env->callBooleanMethod(this$, _mids[mid_isInterface]);
+ }
+
+ int Class::isAssignableFrom(const Class& obj) const
+ {
+ return (int) env->callBooleanMethod(this$, _mids[mid_isAssignableFrom], obj.this$);
+ }
+
+ Class Class::getComponentType() const
+ {
+ return Class(env->callObjectMethod(this$, _mids[mid_getComponentType]));
+ }
+
+ Class Class::getSuperclass() const
+ {
+ return Class(env->callObjectMethod(this$, _mids[mid_getSuperclass]));
+ }
+
+ JArray<Class> Class::getInterfaces() const
+ {
+ jobjectArray array = (jobjectArray)
+ env->callObjectMethod(this$, _mids[mid_getInterfaces]);
+
+ return JArray<Class>(array);
+ }
+
+ String Class::getName() const
+ {
+ return String(env->callObjectMethod(this$, _mids[mid_getName]));
+ }
+
+ int Class::getModifiers() const
+ {
+ return env->callIntMethod(this$, _mids[mid_getModifiers]);
+ }
+
+ int Class::isInstance(const Object &obj) const
+ {
+ return env->callBooleanMethod(this$, _mids[mid_isInstance],
+ obj.this$);
+ }
+ }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+ namespace lang {
+ using namespace reflect;
+
+ static PyObject *t_Class_forName(PyTypeObject *type, PyObject *arg);
+ static PyObject *t_Class_getDeclaredConstructors(t_Class *self);
+ static PyObject *t_Class_getDeclaredMethods(t_Class *self);
+ static PyObject *t_Class_getMethods(t_Class *self);
+ static PyObject *t_Class_getMethod(t_Class *self, PyObject *args);
+ static PyObject *t_Class_getDeclaredMethod(t_Class *self, PyObject *args);
+ static PyObject *t_Class_getDeclaredFields(t_Class *self);
+ static PyObject *t_Class_getDeclaredClasses(t_Class *self);
+ static PyObject *t_Class_isArray(t_Class *self);
+ static PyObject *t_Class_isPrimitive(t_Class *self);
+ static PyObject *t_Class_isInterface(t_Class *self);
+ static PyObject *t_Class_isAssignableFrom(t_Class *self, PyObject *arg);
+ static PyObject *t_Class_getComponentType(t_Class *self);
+ static PyObject *t_Class_getSuperclass(t_Class *self);
+ static PyObject *t_Class_getInterfaces(t_Class *self);
+ static PyObject *t_Class_getName(t_Class *self);
+ static PyObject *t_Class_getModifiers(t_Class *self);
+
+ static PyMethodDef t_Class__methods_[] = {
+ DECLARE_METHOD(t_Class, forName, METH_O | METH_CLASS),
+ DECLARE_METHOD(t_Class, getDeclaredConstructors, METH_NOARGS),
+ DECLARE_METHOD(t_Class, getDeclaredMethods, METH_NOARGS),
+ DECLARE_METHOD(t_Class, getMethods, METH_NOARGS),
+ DECLARE_METHOD(t_Class, getMethod, METH_VARARGS),
+ DECLARE_METHOD(t_Class, getDeclaredMethod, METH_VARARGS),
+ DECLARE_METHOD(t_Class, getDeclaredFields, METH_NOARGS),
+ DECLARE_METHOD(t_Class, getDeclaredClasses, METH_NOARGS),
+ DECLARE_METHOD(t_Class, isArray, METH_NOARGS),
+ DECLARE_METHOD(t_Class, isPrimitive, METH_NOARGS),
+ DECLARE_METHOD(t_Class, isInterface, METH_NOARGS),
+ DECLARE_METHOD(t_Class, isAssignableFrom, METH_O),
+ DECLARE_METHOD(t_Class, getComponentType, METH_NOARGS),
+ DECLARE_METHOD(t_Class, getSuperclass, METH_NOARGS),
+ DECLARE_METHOD(t_Class, getInterfaces, METH_NOARGS),
+ DECLARE_METHOD(t_Class, getName, METH_NOARGS),
+ DECLARE_METHOD(t_Class, getModifiers, METH_NOARGS),
+ { NULL, NULL, 0, NULL }
+ };
+
+ DECLARE_TYPE(Class, t_Class, Object, java::lang::Class,
+ abstract_init, 0, 0, 0, 0, 0);
+
+ static PyObject *t_Class_forName(PyTypeObject *type, PyObject *arg)
+ {
+ if (!PyString_Check(arg))
+ {
+ PyErr_SetObject(PyExc_TypeError, arg);
+ return NULL;
+ }
+
+ try {
+ char *className = PyString_AsString(arg);
+ String name = String(env->fromUTF(className));
+
+ return t_Class::wrap_Object(Class::forName(name));
+ } catch (JCCEnv::exception e) {
+ return PyErr_SetJavaError(e.throwable);
+ }
+ }
+
+ static PyObject *t_Class_getDeclaredConstructors(t_Class *self)
+ {
+ JArray<Constructor> constructors((jobject) NULL);
+
+ OBJ_CALL(constructors = self->object.getDeclaredConstructors());
+ return constructors.toSequence(t_Constructor::wrap_Object);
+ }
+
+ static PyObject *t_Class_getDeclaredMethods(t_Class *self)
+ {
+ JArray<Method> methods((jobject) NULL);
+
+ OBJ_CALL(methods = self->object.getDeclaredMethods());
+ return methods.toSequence(t_Method::wrap_Object);
+ }
+
+ static PyObject *t_Class_getMethods(t_Class *self)
+ {
+ JArray<Method> methods((jobject) NULL);
+
+ OBJ_CALL(methods = self->object.getMethods());
+ return methods.toSequence(t_Method::wrap_Object);
+ }
+
+ static PyObject *t_Class_getMethod(t_Class *self, PyObject *args)
+ {
+ String name((jobject) NULL);
+ JArray<Class> params((jobject) NULL);
+ Method method((jobject) NULL);
+
+ if (!parseArgs(args, "s[j", Class::class$, &name, ¶ms))
+ {
+ OBJ_CALL(method = self->object.getMethod(name, params));
+ return t_Method::wrap_Object(method);
+ }
+
+ return PyErr_SetArgsError((PyObject *) self, "getMethod", args);
+ }
+
+ static PyObject *t_Class_getDeclaredMethod(t_Class *self, PyObject *args)
+ {
+ String name((jobject) NULL);
+ JArray<Class> params((jobject) NULL);
+ Method method((jobject) NULL);
+
+ if (!parseArgs(args, "s[j", Class::class$, &name, ¶ms))
+ {
+ OBJ_CALL(method = self->object.getDeclaredMethod(name, params));
+ return t_Method::wrap_Object(method);
+ }
+
+ return PyErr_SetArgsError((PyObject *) self, "getMethod", args);
+ }
+
+ static PyObject *t_Class_getDeclaredFields(t_Class *self)
+ {
+ JArray<Field> fields((jobject) NULL);
+
+ OBJ_CALL(fields = self->object.getDeclaredFields());
+ return fields.toSequence(t_Field::wrap_Object);
+ }
+
+ static PyObject *t_Class_getDeclaredClasses(t_Class *self)
+ {
+ JArray<Class> array((jobject) NULL);
+
+ OBJ_CALL(array = self->object.getDeclaredClasses());
+ return array.toSequence(t_Class::wrap_Object);
+ }
+
+ static PyObject *t_Class_isArray(t_Class *self)
+ {
+ int isArray;
+
+ OBJ_CALL(isArray = self->object.isArray());
+ Py_RETURN_BOOL(isArray);
+ }
+
+ static PyObject *t_Class_isPrimitive(t_Class *self)
+ {
+ int isPrimitive;
+
+ OBJ_CALL(isPrimitive = self->object.isPrimitive());
+ Py_RETURN_BOOL(isPrimitive);
+ }
+
+ static PyObject *t_Class_isInterface(t_Class *self)
+ {
+ int isInterface;
+
+ OBJ_CALL(isInterface = self->object.isInterface());
+ Py_RETURN_BOOL(isInterface);
+ }
+
+ static PyObject *t_Class_isAssignableFrom(t_Class *self, PyObject *arg)
+ {
+ if (!PyObject_TypeCheck(arg, &ClassType))
+ {
+ PyErr_SetObject(PyExc_TypeError, arg);
+ return NULL;
+ }
+
+ try {
+ Class cls = ((t_Class *) arg)->object;
+ int isAssignableFrom = self->object.isAssignableFrom(cls);
+
+ Py_RETURN_BOOL(isAssignableFrom);
+ } catch (JCCEnv::exception e) {
+ return PyErr_SetJavaError(e.throwable);
+ }
+ }
+
+ static PyObject *t_Class_getComponentType(t_Class *self)
+ {
+ Class cls((jobject) NULL);
+
+ OBJ_CALL(cls = self->object.getComponentType());
+ return t_Class::wrap_Object(cls);
+ }
+
+ static PyObject *t_Class_getSuperclass(t_Class *self)
+ {
+ Class cls((jobject) NULL);
+
+ OBJ_CALL(cls = self->object.getSuperclass());
+ return t_Class::wrap_Object(cls);
+ }
+
+ static PyObject *t_Class_getInterfaces(t_Class *self)
+ {
+ JArray<Class> interfaces((jobject) NULL);
+
+ OBJ_CALL(interfaces = self->object.getInterfaces());
+ return interfaces.toSequence(t_Class::wrap_Object);
+ }
+
+ static PyObject *t_Class_getName(t_Class *self)
+ {
+ String name((jobject) NULL);
+
+ OBJ_CALL(name = self->object.getName());
+ return j2p(name);
+ }
+
+ static PyObject *t_Class_getModifiers(t_Class *self)
+ {
+ jint modifiers;
+
+ OBJ_CALL(modifiers = self->object.getModifiers());
+ return PyInt_FromLong(modifiers);
+ }
+
+ }
+}
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Class.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Class.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Class.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Class.h?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Class.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Class.h Thu Jan 8 19:28:33 2009
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _Class_H
+#define _Class_H
+
+#include <Python.h>
+#include "JArray.h"
+#include "java/lang/Object.h"
+
+namespace java {
+ namespace lang {
+ namespace reflect {
+ class Method;
+ class Constructor;
+ class Field;
+ }
+
+ using namespace reflect;
+
+ class Class : public Object {
+ public:
+ static Class *class$;
+ static jmethodID *_mids;
+ static jclass initializeClass();
+
+ explicit Class(jobject obj) : Object(obj) {
+ initializeClass();
+ }
+ Class(const Class& obj) : Object(obj) {}
+
+ static Class forName(const String& className);
+ JArray<Method> getDeclaredMethods() const;
+ JArray<Method> getMethods() const;
+ Method getMethod(const String &name, const JArray<Class>& params) const;
+ Method getDeclaredMethod(const String &name, const JArray<Class>& params) const;
+ JArray<Constructor> getDeclaredConstructors() const;
+ JArray<Field> getDeclaredFields() const;
+ JArray<Class> getDeclaredClasses() const;
+ int isArray() const;
+ int isPrimitive() const;
+ int isInterface() const;
+ int isAssignableFrom(const Class& obj) const;
+ Class getComponentType() const;
+ Class getSuperclass() const;
+ JArray<Class> getInterfaces() const;
+ String getName() const;
+ int getModifiers() const;
+ int isInstance(const Object &obj) const;
+ };
+
+ extern PyTypeObject ClassType;
+
+ class t_Class {
+ public:
+ PyObject_HEAD
+ Class object;
+ static PyObject *wrap_Object(const Class& object);
+ static PyObject *wrap_jobject(const jobject& object);
+ };
+ }
+}
+
+#endif /* _Class_H */
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Class.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Class.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.cpp?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.cpp Thu Jan 8 19:28:33 2009
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/Double.h"
+
+namespace java {
+ namespace lang {
+
+ enum {
+ mid__init_,
+ max_mid
+ };
+
+ Class *Double::class$ = NULL;
+ jmethodID *Double::_mids = NULL;
+
+ jclass Double::initializeClass()
+ {
+ if (!class$)
+ {
+ jclass cls = env->findClass("java/lang/Double");
+
+ _mids = new jmethodID[max_mid];
+ _mids[mid__init_] = env->getMethodID(cls, "<init>", "(D)V");
+
+ class$ = (Class *) new JObject(cls);
+ }
+
+ return (jclass) class$->this$;
+ }
+
+ Double::Double(jdouble n) : Object(env->newObject(initializeClass, &_mids, mid__init_, n)) {
+ }
+ }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+ namespace lang {
+
+ static PyMethodDef t_Double__methods_[] = {
+ { NULL, NULL, 0, NULL }
+ };
+
+ DECLARE_TYPE(Double, t_Double, Object, java::lang::Double,
+ abstract_init, 0, 0, 0, 0, 0);
+ }
+}
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.h?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.h Thu Jan 8 19:28:33 2009
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _Double_H
+#define _Double_H
+
+#include <Python.h>
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+
+namespace java {
+ namespace lang {
+
+ class Double : public Object {
+ public:
+ static Class *class$;
+ static jmethodID *_mids;
+ static jclass initializeClass();
+
+ explicit Double(jobject obj) : Object(obj) {
+ initializeClass();
+ }
+ Double(jdouble);
+ };
+
+ extern PyTypeObject DoubleType;
+
+ class t_Double {
+ public:
+ PyObject_HEAD
+ Double object;
+ static PyObject *wrap_Object(const Double& object);
+ static PyObject *wrap_jobject(const jobject& object);
+ };
+ }
+}
+
+#endif /* _Double_H */
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Double.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Exception.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Exception.cpp?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Exception.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Exception.cpp Thu Jan 8 19:28:33 2009
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/Exception.h"
+
+namespace java {
+ namespace lang {
+
+ enum {
+ mid_printStackTrace,
+ max_mid
+ };
+
+ Class *Exception::class$ = NULL;
+ jmethodID *Exception::_mids = NULL;
+
+ jclass Exception::initializeClass()
+ {
+ if (!class$)
+ {
+ jclass cls = env->findClass("java/lang/Exception");
+
+ class$ = (Class *) new JObject(cls);
+ }
+
+ return (jclass) class$->this$;
+ }
+ }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+ namespace lang {
+
+
+ static PyMethodDef t_Exception__methods_[] = {
+ { NULL, NULL, 0, NULL }
+ };
+
+ DECLARE_TYPE(Exception, t_Exception, Object, java::lang::Exception,
+ abstract_init, 0, 0, 0, 0, 0);
+ }
+}
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Exception.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Exception.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Exception.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Exception.h?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Exception.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Exception.h Thu Jan 8 19:28:33 2009
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _Exception_H
+#define _Exception_H
+
+#include <Python.h>
+#include "java/lang/Class.h"
+#include "java/lang/Throwable.h"
+#include "JArray.h"
+
+namespace java {
+ namespace lang {
+
+ class Exception : public Throwable {
+ public:
+ static Class *class$;
+ static jmethodID *_mids;
+ static jclass initializeClass();
+
+ explicit Exception(jobject obj) : Throwable(obj) {
+ initializeClass();
+ }
+ };
+
+ extern PyTypeObject ExceptionType;
+
+ class t_Exception {
+ public:
+ PyObject_HEAD
+ Exception object;
+ static PyObject *wrap_Object(const Exception& object);
+ static PyObject *wrap_jobject(const jobject& object);
+ };
+ }
+}
+
+#endif /* _Exception_H */
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Exception.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Exception.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.cpp?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.cpp Thu Jan 8 19:28:33 2009
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/Integer.h"
+
+namespace java {
+ namespace lang {
+
+ enum {
+ mid__init_,
+ max_mid
+ };
+
+ Class *Integer::class$ = NULL;
+ jmethodID *Integer::_mids = NULL;
+
+ jclass Integer::initializeClass()
+ {
+ if (!class$)
+ {
+ jclass cls = env->findClass("java/lang/Integer");
+
+ _mids = new jmethodID[max_mid];
+ _mids[mid__init_] = env->getMethodID(cls, "<init>", "(I)V");
+
+ class$ = (Class *) new JObject(cls);
+ }
+
+ return (jclass) class$->this$;
+ }
+
+ Integer::Integer(jint n) : Object(env->newObject(initializeClass, &_mids, mid__init_, n)) {
+ }
+ }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+ namespace lang {
+
+ static PyMethodDef t_Integer__methods_[] = {
+ { NULL, NULL, 0, NULL }
+ };
+
+ DECLARE_TYPE(Integer, t_Integer, Object, java::lang::Integer,
+ abstract_init, 0, 0, 0, 0, 0);
+ }
+}
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.h?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.h Thu Jan 8 19:28:33 2009
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _Integer_H
+#define _Integer_H
+
+#include <Python.h>
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+
+namespace java {
+ namespace lang {
+
+ class Integer : public Object {
+ public:
+ static Class *class$;
+ static jmethodID *_mids;
+ static jclass initializeClass();
+
+ explicit Integer(jobject obj) : Object(obj) {
+ initializeClass();
+ }
+ Integer(jint);
+ };
+
+ extern PyTypeObject IntegerType;
+
+ class t_Integer {
+ public:
+ PyObject_HEAD
+ Integer object;
+ static PyObject *wrap_Object(const Integer& object);
+ static PyObject *wrap_jobject(const jobject& object);
+ };
+ }
+}
+
+#endif /* _Integer_H */
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Integer.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.cpp?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.cpp Thu Jan 8 19:28:33 2009
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/Long.h"
+
+namespace java {
+ namespace lang {
+
+ enum {
+ mid__init_,
+ max_mid
+ };
+
+ Class *Long::class$ = NULL;
+ jmethodID *Long::_mids = NULL;
+
+ jclass Long::initializeClass()
+ {
+ if (!class$)
+ {
+ jclass cls = env->findClass("java/lang/Long");
+
+ _mids = new jmethodID[max_mid];
+ _mids[mid__init_] = env->getMethodID(cls, "<init>", "(J)V");
+
+ class$ = (Class *) new JObject(cls);
+ }
+
+ return (jclass) class$->this$;
+ }
+
+ Long::Long(jlong n) : Object(env->newObject(initializeClass, &_mids, mid__init_, n)) {
+ }
+ }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+ namespace lang {
+
+ static PyMethodDef t_Long__methods_[] = {
+ { NULL, NULL, 0, NULL }
+ };
+
+ DECLARE_TYPE(Long, t_Long, Object, java::lang::Long,
+ abstract_init, 0, 0, 0, 0, 0);
+ }
+}
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.h?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.h Thu Jan 8 19:28:33 2009
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _Long_H
+#define _Long_H
+
+#include <Python.h>
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+
+namespace java {
+ namespace lang {
+
+ class Long : public Object {
+ public:
+ static Class *class$;
+ static jmethodID *_mids;
+ static jclass initializeClass();
+
+ explicit Long(jobject obj) : Object(obj) {
+ initializeClass();
+ }
+ Long(jlong);
+ };
+
+ extern PyTypeObject LongType;
+
+ class t_Long {
+ public:
+ PyObject_HEAD
+ Long object;
+ static PyObject *wrap_Object(const Long& object);
+ static PyObject *wrap_jobject(const jobject& object);
+ };
+ }
+}
+
+#endif /* _Long_H */
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Long.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Object.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Object.cpp?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Object.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Object.cpp Thu Jan 8 19:28:33 2009
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/String.h"
+
+namespace java {
+ namespace lang {
+ enum {
+ mid__init_,
+ mid_toString,
+ mid_getClass,
+ mid_hashCode,
+ max_mid
+ };
+
+ Class *Object::class$ = NULL;
+ jmethodID *Object::mids$ = NULL;
+
+ jclass Object::initializeClass()
+ {
+ if (!class$)
+ {
+ jclass cls = env->findClass("java/lang/Object");
+
+ mids$ = new jmethodID[max_mid];
+ mids$[mid__init_] = env->getMethodID(cls, "<init>",
+ "()V");
+ mids$[mid_toString] = env->getMethodID(cls, "toString",
+ "()Ljava/lang/String;");
+ mids$[mid_getClass] = env->getMethodID(cls, "getClass",
+ "()Ljava/lang/Class;");
+ mids$[mid_hashCode] = env->getMethodID(cls, "hashCode",
+ "()I");
+
+ class$ = (Class *) new JObject(cls);
+ }
+
+ return (jclass) class$->this$;
+ }
+
+ Object::Object() : JObject(env->newObject(initializeClass, &mids$, mid__init_)) {
+ }
+
+ String Object::toString() const
+ {
+ return String(env->callObjectMethod(this$, mids$[mid_toString]));
+ }
+
+ Class Object::getClass() const
+ {
+ return Class(env->callObjectMethod(this$, mids$[mid_getClass]));
+ }
+
+ int Object::hashCode() const
+ {
+ return env->callIntMethod(this$, mids$[mid_hashCode]);
+ }
+ }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+ namespace lang {
+
+ static int t_Object_init(t_Object *self,
+ PyObject *args, PyObject *kwds);
+ static PyObject *t_Object_getClass(t_Object *self);
+
+ static PyMethodDef t_Object__methods_[] = {
+ DECLARE_METHOD(t_Object, getClass, METH_NOARGS),
+ { NULL, NULL, 0, NULL }
+ };
+
+ DECLARE_TYPE(Object, t_Object, JObject, java::lang::Object,
+ t_Object_init, 0, 0, 0, 0, 0);
+
+ static int t_Object_init(t_Object *self,
+ PyObject *args, PyObject *kwds)
+ {
+ switch (PyTuple_Size(args)) {
+ case 0:
+ INT_CALL(self->object = Object());
+ break;
+ default:
+ PyErr_SetString(PyExc_ValueError, "invalid args");
+ return -1;
+ }
+
+ return 0;
+ }
+
+ static PyObject *t_Object_getClass(t_Object *self)
+ {
+ Class cls((jobject) NULL);
+
+ OBJ_CALL(cls = self->object.getClass());
+ return t_Class::wrap_Object(cls);
+ }
+ }
+}
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Object.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Object.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Object.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Object.h?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Object.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Object.h Thu Jan 8 19:28:33 2009
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _Object_H
+#define _Object_H
+
+#include <Python.h>
+#include "JObject.h"
+
+namespace java {
+ namespace lang {
+ class Class;
+ class String;
+
+ class Object : public JObject {
+ public:
+ static Class *class$;
+ static jmethodID *mids$;
+ static jclass initializeClass();
+
+ explicit Object();
+ explicit Object(jobject obj) : JObject(obj) {
+ initializeClass();
+ }
+
+ String toString() const;
+ Class getClass() const;
+ int hashCode() const;
+ };
+
+ extern PyTypeObject ObjectType;
+
+ class t_Object {
+ public:
+ PyObject_HEAD
+ Object object;
+ static PyObject *wrap_Object(const Object& object);
+ static PyObject *wrap_jobject(const jobject& object);
+ };
+ }
+}
+
+
+#endif /* _Object_H */
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Object.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Object.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/RuntimeException.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/RuntimeException.cpp?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/RuntimeException.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/RuntimeException.cpp Thu Jan 8 19:28:33 2009
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/RuntimeException.h"
+
+namespace java {
+ namespace lang {
+
+ enum {
+ mid_printStackTrace,
+ max_mid
+ };
+
+ Class *RuntimeException::class$ = NULL;
+ jmethodID *RuntimeException::_mids = NULL;
+
+ jclass RuntimeException::initializeClass()
+ {
+ if (!class$)
+ {
+ jclass cls = env->findClass("java/lang/RuntimeException");
+
+ class$ = (Class *) new JObject(cls);
+ }
+
+ return (jclass) class$->this$;
+ }
+ }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+ namespace lang {
+
+
+ static PyMethodDef t_RuntimeException__methods_[] = {
+ { NULL, NULL, 0, NULL }
+ };
+
+ DECLARE_TYPE(RuntimeException, t_RuntimeException, Object,
+ java::lang::RuntimeException, abstract_init,
+ 0, 0, 0, 0, 0);
+ }
+}
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/RuntimeException.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/RuntimeException.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/RuntimeException.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/RuntimeException.h?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/RuntimeException.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/RuntimeException.h Thu Jan 8 19:28:33 2009
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _RuntimeException_H
+#define _RuntimeException_H
+
+#include <Python.h>
+#include "java/lang/Class.h"
+#include "java/lang/Exception.h"
+#include "JArray.h"
+
+namespace java {
+ namespace lang {
+
+ class RuntimeException : public Exception {
+ public:
+ static Class *class$;
+ static jmethodID *_mids;
+ static jclass initializeClass();
+
+ explicit RuntimeException(jobject obj) : Exception(obj) {
+ initializeClass();
+ }
+ };
+
+ extern PyTypeObject RuntimeExceptionType;
+
+ class t_RuntimeException {
+ public:
+ PyObject_HEAD
+ RuntimeException object;
+ static PyObject *wrap_Object(const RuntimeException& object);
+ static PyObject *wrap_jobject(const jobject& object);
+ };
+ }
+}
+
+#endif /* _RuntimeException_H */
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/RuntimeException.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/RuntimeException.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/String.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/String.cpp?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/String.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/String.cpp Thu Jan 8 19:28:33 2009
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include <string.h>
+#include "JCCEnv.h"
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/String.h"
+
+namespace java {
+ namespace lang {
+
+ enum {
+ mid__init_,
+ mid_toString,
+ mid_length,
+ max_mid
+ };
+
+ Class *String::class$ = NULL;
+ jmethodID *String::_mids = NULL;
+
+ jclass String::initializeClass()
+ {
+ if (!class$)
+ {
+ jclass cls = env->findClass("java/lang/String");
+
+ _mids = new jmethodID[max_mid];
+ _mids[mid__init_] =
+ env->getMethodID(cls, "<init>",
+ "()V");
+ _mids[mid_toString] =
+ env->getMethodID(cls, "toString",
+ "()Ljava/lang/String;");
+ _mids[mid_length] =
+ env->getMethodID(cls, "length",
+ "()I");
+
+ class$ = (Class *) new JObject(cls);
+ }
+
+ return (jclass) class$->this$;
+ }
+
+ String::String() : Object(env->newObject(initializeClass, &_mids, mid__init_)) {
+ }
+
+ int String::length() const
+ {
+ return env->callIntMethod(this$, _mids[mid_length]);
+ }
+ }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+ namespace lang {
+
+ static int t_String_init(t_String *self,
+ PyObject *args, PyObject *kwds);
+ static PyObject *t_String_length(t_String *self);
+
+ static PyMethodDef t_String__methods_[] = {
+ DECLARE_METHOD(t_String, length, METH_NOARGS),
+ { NULL, NULL, 0, NULL }
+ };
+
+ DECLARE_TYPE(String, t_String, Object, java::lang::String,
+ t_String_init, 0, 0, 0, 0, 0);
+
+ static int t_String_init(t_String *self,
+ PyObject *args, PyObject *kwds)
+ {
+ char *bytes;
+
+ switch (PyTuple_Size(args)) {
+ case 0:
+ INT_CALL(self->object = String());
+ break;
+ case 1:
+ if (!PyArg_ParseTuple(args, "s", &bytes))
+ return -1;
+ INT_CALL(self->object = String(env->fromUTF(bytes)));
+ break;
+ default:
+ PyErr_SetString(PyExc_ValueError, "invalid args");
+ return -1;
+ }
+
+ return 0;
+ }
+
+ static PyObject *t_String_length(t_String *self)
+ {
+ jint length;
+
+ OBJ_CALL(length = self->object.length());
+ return PyInt_FromLong(length);
+ }
+ }
+}
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/String.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/String.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/String.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/String.h?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/String.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/String.h Thu Jan 8 19:28:33 2009
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _String_H
+#define _String_H
+
+#include <Python.h>
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "JArray.h"
+
+namespace java {
+ namespace lang {
+
+ class String : public Object {
+ public:
+ static Class *class$;
+ static jmethodID *_mids;
+ static jclass initializeClass();
+
+ explicit String(jobject obj) : Object(obj) {
+ initializeClass();
+ }
+ String();
+ String(const String& obj) : Object(obj) {}
+
+ String toString() const {
+ return *this;
+ }
+ int length() const;
+ };
+
+ extern PyTypeObject StringType;
+
+ class t_String {
+ public:
+ PyObject_HEAD
+ String object;
+ static PyObject *wrap_Object(const String& object);
+ static PyObject *wrap_jobject(const jobject& object);
+ };
+ }
+}
+
+#endif /* _String_H */
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/String.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/String.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Throwable.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Throwable.cpp?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Throwable.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Throwable.cpp Thu Jan 8 19:28:33 2009
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "java/lang/String.h"
+#include "java/lang/Throwable.h"
+
+namespace java {
+ namespace lang {
+
+ enum {
+ mid_printStackTrace,
+ mid_getMessage,
+ max_mid
+ };
+
+ Class *Throwable::class$ = NULL;
+ jmethodID *Throwable::_mids = NULL;
+
+ jclass Throwable::initializeClass()
+ {
+ if (!class$)
+ {
+ jclass cls = env->findClass("java/lang/Throwable");
+
+ _mids = new jmethodID[max_mid];
+ _mids[mid_printStackTrace] =
+ env->getMethodID(cls, "printStackTrace",
+ "()V");
+ _mids[mid_getMessage] =
+ env->getMethodID(cls, "getMessage",
+ "()Ljava/lang/String;");
+
+ class$ = (Class *) new JObject(cls);
+ }
+
+ return (jclass) class$->this$;
+ }
+
+ void Throwable::printStackTrace() const
+ {
+ env->callVoidMethod(this$, _mids[mid_printStackTrace]);
+ }
+
+ String Throwable::getMessage() const
+ {
+ return String(env->callObjectMethod(this$, _mids[mid_getMessage]));
+ }
+ }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+ namespace lang {
+
+ static PyObject *t_Throwable_printStackTrace(t_Throwable *self);
+
+ static PyMethodDef t_Throwable__methods_[] = {
+ DECLARE_METHOD(t_Throwable, printStackTrace, METH_NOARGS),
+ { NULL, NULL, 0, NULL }
+ };
+
+ DECLARE_TYPE(Throwable, t_Throwable, Object, java::lang::Throwable,
+ abstract_init, 0, 0, 0, 0, 0);
+
+ static PyObject *t_Throwable_printStackTrace(t_Throwable *self)
+ {
+ OBJ_CALL(self->object.printStackTrace());
+ Py_RETURN_NONE;
+ }
+ }
+}
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Throwable.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Throwable.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/Throwable.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/Throwable.h?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/Throwable.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/Throwable.h Thu Jan 8 19:28:33 2009
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _Throwable_H
+#define _Throwable_H
+
+#include <Python.h>
+#include "java/lang/Object.h"
+#include "java/lang/Class.h"
+#include "JArray.h"
+
+namespace java {
+ namespace lang {
+ class String;
+
+ class Throwable : public Object {
+ public:
+ static Class *class$;
+ static jmethodID *_mids;
+ static jclass initializeClass();
+
+ explicit Throwable(jobject obj) : Object(obj) {
+ initializeClass();
+ }
+
+ void printStackTrace() const;
+ String getMessage() const;
+ };
+
+ extern PyTypeObject ThrowableType;
+
+ class t_Throwable {
+ public:
+ PyObject_HEAD
+ Throwable object;
+ static PyObject *wrap_Object(const Throwable& object);
+ static PyObject *wrap_jobject(const jobject& object);
+ };
+ }
+}
+
+#endif /* _Throwable_H */
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Throwable.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/Throwable.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/__init__.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/__init__.cpp?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/__init__.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/__init__.cpp Thu Jan 8 19:28:33 2009
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <Python.h>
+#include "macros.h"
+
+namespace java {
+ namespace lang {
+
+ extern PyTypeObject ObjectType;
+ extern PyTypeObject StringType;
+ extern PyTypeObject ClassType;
+ extern PyTypeObject ThrowableType;
+ extern PyTypeObject ExceptionType;
+ extern PyTypeObject RuntimeExceptionType;
+ extern PyTypeObject BooleanType;
+ extern PyTypeObject IntegerType;
+ extern PyTypeObject LongType;
+ extern PyTypeObject DoubleType;
+
+ namespace reflect {
+ void __install__(PyObject *module);
+ }
+
+ void __install__(PyObject *m)
+ {
+ INSTALL_TYPE(Object, m);
+ INSTALL_TYPE(String, m);
+ INSTALL_TYPE(Class, m);
+ INSTALL_TYPE(Throwable, m);
+ INSTALL_TYPE(Exception, m);
+ INSTALL_TYPE(RuntimeException, m);
+ INSTALL_TYPE(Boolean, m);
+ INSTALL_TYPE(Integer, m);
+ INSTALL_TYPE(Long, m);
+ INSTALL_TYPE(Double, m);
+ reflect::__install__(m);
+ }
+ }
+}
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/__init__.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/__init__.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Constructor.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Constructor.cpp?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Constructor.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Constructor.cpp Thu Jan 8 19:28:33 2009
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+#include "JArray.h"
+
+#include "java/lang/Class.h"
+#include "java/lang/Object.h"
+#include "java/lang/String.h"
+#include "java/lang/reflect/Constructor.h"
+
+namespace java {
+ namespace lang {
+ namespace reflect {
+
+ enum {
+ mid_getModifiers,
+ mid_getSignature,
+ mid_getParameterTypes,
+ mid_getExceptionTypes,
+ max_mid
+ };
+
+ Class *Constructor::class$ = NULL;
+ jmethodID *Constructor::_mids = NULL;
+
+ jclass Constructor::initializeClass()
+ {
+ if (!class$)
+ {
+ jclass cls = env->findClass("java/lang/reflect/Constructor");
+
+ _mids = new jmethodID[max_mid];
+ _mids[mid_getModifiers] =
+ env->getMethodID(cls, "getModifiers",
+ "()I");
+ _mids[mid_getParameterTypes] =
+ env->getMethodID(cls, "getParameterTypes",
+ "()[Ljava/lang/Class;");
+ _mids[mid_getExceptionTypes] =
+ env->getMethodID(cls, "getExceptionTypes",
+ "()[Ljava/lang/Class;");
+
+ class$ = (Class *) new JObject(cls);
+ }
+
+ return (jclass) class$->this$;
+ }
+
+ int Constructor::getModifiers() const
+ {
+ return env->callIntMethod(this$, _mids[mid_getModifiers]);
+ }
+
+ JArray<Class> Constructor::getParameterTypes() const
+ {
+ jobjectArray array = (jobjectArray)
+ env->callObjectMethod(this$, _mids[mid_getParameterTypes]);
+
+ return JArray<Class>(array);
+ }
+
+ JArray<Class> Constructor::getExceptionTypes() const
+ {
+ jobjectArray array = (jobjectArray)
+ env->callObjectMethod(this$, _mids[mid_getExceptionTypes]);
+
+ return JArray<Class>(array);
+ }
+ }
+ }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+ namespace lang {
+ namespace reflect {
+
+ static PyObject *t_Constructor_getModifiers(t_Constructor *self);
+ static PyObject *t_Constructor_getParameterTypes(t_Constructor *self);
+ static PyObject *t_Constructor_getExceptionTypes(t_Constructor *self);
+
+ static PyMethodDef t_Constructor__methods_[] = {
+ DECLARE_METHOD(t_Constructor, getModifiers, METH_NOARGS),
+ DECLARE_METHOD(t_Constructor, getParameterTypes, METH_NOARGS),
+ DECLARE_METHOD(t_Constructor, getExceptionTypes, METH_NOARGS),
+ { NULL, NULL, 0, NULL }
+ };
+
+ DECLARE_TYPE(Constructor, t_Constructor, Object, Constructor,
+ abstract_init, 0, 0, 0, 0, 0);
+
+ static PyObject *t_Constructor_getModifiers(t_Constructor *self)
+ {
+ jint modifiers;
+
+ OBJ_CALL(modifiers = self->object.getModifiers());
+ return PyInt_FromLong(modifiers);
+ }
+
+ static PyObject *t_Constructor_getParameterTypes(t_Constructor *self)
+ {
+ JArray<Class> types((jobject) NULL);
+ OBJ_CALL(types = self->object.getParameterTypes());
+ return types.toSequence(t_Class::wrap_Object);
+ }
+
+ static PyObject *t_Constructor_getExceptionTypes(t_Constructor *self)
+ {
+ JArray<Class> types((jobject) NULL);
+ OBJ_CALL(types = self->object.getExceptionTypes());
+ return types.toSequence(t_Class::wrap_Object);
+ }
+ }
+ }
+}
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Constructor.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Constructor.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Constructor.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Constructor.h?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Constructor.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Constructor.h Thu Jan 8 19:28:33 2009
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _Constructor_H
+#define _Constructor_H
+
+#include <Python.h>
+#include "JArray.h"
+
+namespace java {
+ namespace lang {
+ class Class;
+ class String;
+
+ namespace reflect {
+ class Constructor : public Object {
+ public:
+ static Class *class$;
+ static jmethodID *_mids;
+ static jclass initializeClass();
+
+ explicit Constructor(jobject obj) : Object(obj) {
+ initializeClass();
+ }
+ Constructor(const Constructor& obj) : Object(obj) {}
+
+ int getModifiers() const;
+ JArray<Class> getParameterTypes() const;
+ JArray<Class> getExceptionTypes() const;
+ };
+
+
+ extern PyTypeObject ConstructorType;
+
+ class t_Constructor {
+ public:
+ PyObject_HEAD
+ Constructor object;
+ static PyObject *wrap_Object(const Constructor& object);
+ static PyObject *wrap_jobject(const jobject& object);
+ };
+ }
+ }
+}
+
+#endif /* _Constructor_H */
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Constructor.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Constructor.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Field.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Field.cpp?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Field.cpp (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Field.cpp Thu Jan 8 19:28:33 2009
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include "JCCEnv.h"
+#include "java/lang/Class.h"
+#include "java/lang/Object.h"
+#include "java/lang/String.h"
+#include "java/lang/reflect/Field.h"
+
+namespace java {
+ namespace lang {
+ namespace reflect {
+
+ enum {
+ mid_getModifiers,
+ mid_getType,
+ mid_getName,
+ max_mid
+ };
+
+ Class *Field::class$ = NULL;
+ jmethodID *Field::_mids = NULL;
+
+ jclass Field::initializeClass()
+ {
+ if (!class$)
+ {
+ jclass cls = env->findClass("java/lang/reflect/Field");
+
+ _mids = new jmethodID[max_mid];
+ _mids[mid_getModifiers] =
+ env->getMethodID(cls, "getModifiers",
+ "()I");
+ _mids[mid_getType] =
+ env->getMethodID(cls, "getType",
+ "()Ljava/lang/Class;");
+ _mids[mid_getName] =
+ env->getMethodID(cls, "getName",
+ "()Ljava/lang/String;");
+
+ class$ = (Class *) new JObject(cls);
+ }
+
+ return (jclass) class$->this$;
+ }
+
+ int Field::getModifiers() const
+ {
+ return env->callIntMethod(this$, _mids[mid_getModifiers]);
+ }
+
+ Class Field::getType() const
+ {
+ return Class(env->callObjectMethod(this$, _mids[mid_getType]));
+ }
+
+ String Field::getName() const
+ {
+ return String(env->callObjectMethod(this$, _mids[mid_getName]));
+ }
+ }
+ }
+}
+
+
+#include "structmember.h"
+#include "functions.h"
+#include "macros.h"
+
+namespace java {
+ namespace lang {
+ namespace reflect {
+
+ static PyObject *t_Field_getModifiers(t_Field *self);
+ static PyObject *t_Field_getType(t_Field *self);
+ static PyObject *t_Field_getName(t_Field *self);
+
+ static PyMethodDef t_Field__methods_[] = {
+ DECLARE_METHOD(t_Field, getModifiers, METH_NOARGS),
+ DECLARE_METHOD(t_Field, getType, METH_NOARGS),
+ DECLARE_METHOD(t_Field, getName, METH_NOARGS),
+ { NULL, NULL, 0, NULL }
+ };
+
+ DECLARE_TYPE(Field, t_Field, Object, Field,
+ abstract_init, 0, 0, 0, 0, 0);
+
+ static PyObject *t_Field_getModifiers(t_Field *self)
+ {
+ jint modifiers;
+
+ OBJ_CALL(modifiers = self->object.getModifiers());
+ return PyInt_FromLong(modifiers);
+ }
+
+ static PyObject *t_Field_getType(t_Field *self)
+ {
+ Class cls((jobject) NULL);
+
+ OBJ_CALL(cls = self->object.getType());
+ return t_Class::wrap_Object(cls);
+ }
+
+ static PyObject *t_Field_getName(t_Field *self)
+ {
+ String name((jobject) NULL);
+
+ OBJ_CALL(name = self->object.getName());
+ return j2p(name);
+ }
+ }
+ }
+}
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Field.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Field.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Field.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Field.h?rev=732916&view=auto
==============================================================================
--- lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Field.h (added)
+++ lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Field.h Thu Jan 8 19:28:33 2009
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007-2008 Open Source Applications Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _Field_H
+#define _Field_H
+
+#include <Python.h>
+
+namespace java {
+ namespace lang {
+ class Class;
+ class String;
+
+ namespace reflect {
+ class Field : public Object {
+ public:
+ static Class *class$;
+ static jmethodID *_mids;
+ static jclass initializeClass();
+
+ explicit Field(jobject obj) : Object(obj) {
+ initializeClass();
+ }
+ Field(const Field& obj) : Object(obj) {}
+
+ int getModifiers() const;
+ Class getType() const;
+ String getName() const;
+ };
+
+ extern PyTypeObject FieldType;
+
+ class t_Field {
+ public:
+ PyObject_HEAD
+ Field object;
+ static PyObject *wrap_Object(const Field& object);
+ static PyObject *wrap_jobject(const jobject& object);
+ };
+ }
+ }
+}
+
+#endif /* _Field_H */
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Field.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/pylucene/trunk/jcc/_jcc/java/lang/reflect/Field.h
------------------------------------------------------------------------------
svn:mime-type = text/plain