Top Description Fields Constructors Methods
com.ziclix.python.sql.util

public Class PyArgParser

extends Object
Class Inheritance
Imports
org.python.core.Py, .PyObject, java.util.HashMap, .Map

Parse the args and kws for a method call.
Author
brian zimmer

Field Summary

Modifier and TypeField and Description
protected PyObject[]
arguments

Field arguments.

protected Map<String, PyObject>
keywords

Field keywords.

Constructor Summary

AccessConstructor and Description
public
PyArgParser(PyObject[] args, String[] kws)

Construct a parser with the arguments and keywords.

Method Summary

Modifier and TypeMethod and Description
public PyObject
arg(int index)

Return the argument at the given index, raise an IndexError if out of range.

public PyObject
arg(int index, PyObject def)

Return the argument at the given index, or the default if the index is out of range.

public boolean
hasKw(String kw)

Does the keyword exist?

public PyObject
kw(String kw)

Return the value for the keyword, raise a KeyError if the keyword does not exist.

public PyObject
kw(String kw, PyObject def)

Return the value for the keyword, return the default if the keyword does not exist.

public String[]
kws()

Get the array of keywords.

public int
numArg()

Get the number of arguments.

public int
numKw()

How many keywords?

protected void
parse(PyObject[] args, String[] kws)

Method parse

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argumentsback to summary
protected PyObject[] arguments

Field arguments.

keywordsback to summary
protected Map<String, PyObject> keywords

Field keywords.

Constructor Detail

PyArgParserback to summary
public PyArgParser(PyObject[] args, String[] kws)

Construct a parser with the arguments and keywords.

Method Detail

argback to summary
public PyObject arg(int index)

Return the argument at the given index, raise an IndexError if out of range.

argback to summary
public PyObject arg(int index, PyObject def)

Return the argument at the given index, or the default if the index is out of range.

hasKwback to summary
public boolean hasKw(String kw)

Does the keyword exist?

kwback to summary
public PyObject kw(String kw)

Return the value for the keyword, raise a KeyError if the keyword does not exist.

kwback to summary
public PyObject kw(String kw, PyObject def)

Return the value for the keyword, return the default if the keyword does not exist.

kwsback to summary
public String[] kws()

Get the array of keywords.

numArgback to summary
public int numArg()

Get the number of arguments.

numKwback to summary
public int numKw()

How many keywords?

parseback to summary
protected void parse(PyObject[] args, String[] kws)

Method parse