org.python.core
public class ArgParser extends Object
public MatchObject search(PyObject[] args, String[] kws) { ArgParser ap = new ArgParser("search", args, kws, "pattern", "pos", "endpos"); String string = ap.getString(0); int start = ap.getInt(1, 0); int end = ap.getInt(2, string.length()); ...
Constructor Summary | |
---|---|
ArgParser(String funcname, PyObject[] args, String[] kws, String p0)
Create an ArgParser with one method argument
| |
ArgParser(String funcname, PyObject[] args, String[] kws, String p0, String p1)
Create an ArgParser with two method argument
| |
ArgParser(String funcname, PyObject[] args, String[] kws, String p0, String p1, String p2)
Create an ArgParser with three method argument
| |
ArgParser(String funcname, PyObject[] args, String[] kws, String[] paramnames)
Create an ArgParser with three method argument
| |
ArgParser(String funcname, PyObject[] args, String[] kws, String[] paramnames, int minargs) |
Method Summary | |
---|---|
int | getInt(int pos)
Return a required argument as an int.
|
int | getInt(int pos, int def)
Return an optional argument as an int.
|
PyObject | getList(int pos)
Return the remaining arguments as a tuple.
|
PyObject | getPyObject(int pos)
Return a required argument as a PyObject.
|
PyObject | getPyObject(int pos, PyObject def)
Return an optional argument as a PyObject.
|
String | getString(int pos)
Return a required argument as a String.
|
String | getString(int pos, String def)
Return an optional argument as a String.
|
Parameters: funcname Name of the method. Used in error messages. args The actual call arguments supplied in the call. kws The actual keyword names supplied in the call. p0 The expected argument in the method definition.
Parameters: funcname Name of the method. Used in error messages. args The actual call arguments supplied in the call. kws The actual keyword names supplied in the call. p0 The first expected argument in the method definition. p1 The second expected argument in the method definition.
Parameters: funcname Name of the method. Used in error messages. args The actual call arguments supplied in the call. kws The actual keyword names supplied in the call. p0 The first expected argument in the method definition. p1 The second expected argument in the method definition. p2 The third expected argument in the method definition.
Parameters: funcname Name of the method. Used in error messages. args The actual call arguments supplied in the call. kws The actual keyword names supplied in the call. paramnames The list of expected argument in the method definition.
Parameters: pos The position of the argument. First argument is numbered 0.
Parameters: pos The position of the argument. First argument is numbered 0.
Parameters: pos The position of the argument. First argument is numbered 0.
Parameters: pos The position of the argument. First argument is numbered 0.
Parameters: pos The position of the argument. First argument is numbered 0.
Parameters: pos The position of the .. First argument is numbered 0.
Parameters: pos The position of the argument. First argument is numbered 0.