Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documention fix of Javaclass constructor and JavaMultipleMethod #701

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ Reflection classes
.. attribute:: __javaconstructor__

If not set, we assume the default constructor takes no parameters.
Otherwise, it can be a list of all possible signatures of the
constructor. For example, a reflection of the String java class would
look like::
Otherwise, it can be a list of all possible signatures and if it is
varArgs or not as parameters of the constructor. For example,
a reflection of the String java class would look like::

class String(JavaClass):
__javaclass__ = 'java/lang/String'
__metaclass__ = MetaJavaClass
__javaconstructor__ = (
'()V',
'(Ljava/lang/String;)V',
'([C)V',
'([CII)V',
('()V', False),
('(Ljava/lang/String;)V', False),
('([C)V', False),
('([CII)V', False),
# ...
)

Expand Down Expand Up @@ -152,9 +152,12 @@ Reflection classes
__metaclass__ = MetaJavaClass

getBytes = JavaMultipleMethod([
'(Ljava/lang/String;)[B',
'(Ljava/nio/charset/Charset;)[B',
'()[B'])
('(Ljava/lang/String;)[B', False, False),
('(Ljava/nio/charset/Charset;)[B', False, False),
('()[B', False, False)])

Each method should contain three informations: its signature, is static,
and is varArgs.

Then, when you try to access this method, it will choose the best
method available according to the type of the arguments you're using.
Expand Down