mirror of https://github.com/kivy/pyjnius.git
change to getMethods and getFields to get inherited methods/fields too
and small doc fix
This commit is contained in:
parent
2eea0f45d3
commit
9ec504dfd6
|
@ -9,7 +9,7 @@ Quick overview
|
|||
--------------
|
||||
|
||||
```python
|
||||
>>> from jnius import autoclass
|
||||
>>> from jnius.reflect import autoclass
|
||||
>>> autoclass('java.lang.System').out.println('Hello world')
|
||||
Hello world
|
||||
|
||||
|
|
|
@ -623,7 +623,7 @@ cdef class JavaMethod(object):
|
|||
<char *>self.definition)
|
||||
|
||||
if self.j_method == NULL:
|
||||
raise JavaException('Unable to found the method'
|
||||
raise JavaException('Unable to find the method'
|
||||
' {0}({1})'.format(self.name, self.definition))
|
||||
|
||||
cdef void set_resolve_info(self, JNIEnv *j_env, jclass j_cls,
|
||||
|
|
|
@ -9,6 +9,8 @@ class Class(JavaClass):
|
|||
|
||||
forName = JavaStaticMethod('(Ljava/lang/String;)Ljava/lang/Class;')
|
||||
getConstructors = JavaMethod('()[Ljava/lang/reflect/Constructor;')
|
||||
getMethods = JavaMethod('()[Ljava/lang/reflect/Method;')
|
||||
getFields = JavaMethod('()[Ljava/lang/reflect/Field;')
|
||||
getDeclaredMethods = JavaMethod('()[Ljava/lang/reflect/Method;')
|
||||
getDeclaredFields = JavaMethod('()[Ljava/lang/reflect/Field;')
|
||||
getName = JavaMethod('()Ljava/lang/String;')
|
||||
|
@ -112,7 +114,7 @@ def autoclass(clsname):
|
|||
constructors.append(sig)
|
||||
classDict['__javaconstructor__'] = constructors
|
||||
|
||||
methods = c.getDeclaredMethods()
|
||||
methods = c.getMethods()
|
||||
methods_name = [x.getName() for x in methods]
|
||||
for index, method in enumerate(methods):
|
||||
name = methods_name[index]
|
||||
|
@ -159,7 +161,7 @@ def autoclass(clsname):
|
|||
|
||||
classDict[name] = JavaMethodMultiple(signatures)
|
||||
|
||||
for field in c.getDeclaredFields():
|
||||
for field in c.getFields():
|
||||
static = Modifier.isStatic(field.getModifiers())
|
||||
sig = get_signature(field.getType())
|
||||
cls = JavaStaticField if static else JavaField
|
||||
|
|
Loading…
Reference in New Issue