* Basic helper implementation of {@link #doDir}. It merges information
* from jpkg {@link PyJavaPackage#clsSet} and {@link PyJavaPackage#__dict__}.
*/
protected PyList basicDoDir(PyJavaPackage jpkg, boolean instantiate,
boolean exclpkgs) {
PyStringMap dict = jpkg.__dict__;
PyStringMap cls = jpkg.clsSet;
if (!instantiate) {
PyList ret = cls.keys();
PyList dictKeys = dict.keys();
for (PyObject name : dictKeys.asIterable()) {
if (!cls.has_key(name)) {
if (exclpkgs && dict.get(name) instanceof PyJavaPackage)
continue;
ret.append(name);
}
}
return ret;
}
for (PyObject pyname : cls.keys().asIterable()) {
if (!dict.has_key(pyname)) {
String name = pyname.toString();
jpkg.addClass(name, Py.findClass(jpkg.__name__ + "." + name));
}
}