PyMethodDescr
is a callable object itself,
and provides binding behaviour through
__get__
, which usually creates a
PyJavaFunction
.
It suits us to sub-class PyMethodDescr
to express the
multiplicity of implementations and to respond to the signature
of the method, optimising its data flow to arguments. Instances
are therefore obtained by calling
fromParser
.
Modifier and Type | Class and Description |
---|---|
private abstract static class | PyMethodDescr.AbstractPositional
Base class for methods that accept between defined maximum and
minimum numbers of arguments |
private static class | PyMethodDescr.General
The implementation may have any signature supportable in Python
by |
private static class | PyMethodDescr.Multiple
A name space for sub-classes of |
private static class | PyMethodDescr.NoArgs
A method represented by |
private static class | PyMethodDescr.O1
The implementation signature requires |
private static class | PyMethodDescr.O2
The implementation signature requires |
private static class | PyMethodDescr.O3
The implementation signature requires |
private static class | PyMethodDescr.Positional
A method represented by |
Modifier and Type | Field and Description |
---|---|
pack-priv final ArgParser | argParser
An argument parser supplied to this |
pack-priv final MethodHandle | method
A handle to the implementation of the function or method. |
pack-priv final MethodSignature | signature
Deduced method signature (useful to have cached when constructing
a |
pack-priv static final PyType |
Access | Constructor and Description |
---|---|
protected | PyMethodDescr(PyType
the class declaring the method objclass, ArgParser describing the signature of the method argParser, MethodSignature to which to coerce the handle signature, MethodHandle handle to invoke the wrapped method or method)null
signifying a matching empty handle.Construct a Python |
Modifier and Type | Method and Description |
---|---|
pack-priv Object | Returns: result of calling the wrapped methodall arguments beginning with args, String[] self of keyword arguments names)Invoke the Java method this method descriptor points to, using
the standard |
pack-priv Object | Returns: method bound toobj or this descriptor.target (self) of the method, or obj, PyType null ignored type)Implements abstract org. obj as its "self"
argument, or if obj==null , return this descriptor.
|
pack-priv String | |
pack-priv Object | |
public Object | call(Object[]
all arguments given, positional then keyword args, String[] of keyword arguments or names)null Implements org. Object[] and String[] ), providing all the
argument values from the caller and names for those given by
keyword.
|
public Object | call(Object
single argument (may be self)self )Overrides default org. |
public Object | call(Object
zeroth argument (may be self, Object self )next argument a1)Overrides default org. |
public Object | call(Object
zeroth argument (may be self, Object self )next argument a1, Object next argument a2)Overrides default org. |
public Object | |
pack-priv abstract Object | Returns: result of the method calltarget object of the method call self, Object[] arguments of the method call args, String[] of arguments given by keyword or names)null Invoke the wrapped method handle for the given target
|
pack-priv abstract Object | Returns: result of the method calltarget object of the method call self, Object[] arguments of the method call args)Invoke the wrapped method handle for the given target
|
protected final void | checkSelfType(Object
to be checked self)Make sure that the argument is acceptable as 'self' by checking
against the MRO of |
pack-priv static PyMethodDescr | Returns: a method descriptor supporting the signatureowning class objclass, ArgParser argument parser (provides name etc.) ap, List<MethodHandle> method handles for the implementations candidates)Construct a Python |
pack-priv Object | |
pack-priv Object | |
pack-priv MethodHandle | Returns: corresponding handle (or one that throwsEmptyException )the self)self argument in some callReturn the handle contained in this descriptor applicable to the
Java class of a |
protected MethodHandle[] | Returns: method handles aligned toobjclass.clases handle type information distilled from parser sig, List<MethodHandle> handles on which to base return candidates)Construct an array of method handles, one for each accepted
implementation of |
protected TypeError | |
pack-priv Object |