org.python.core
Class PathPackageManager
java.lang.Object
org.python.core.PackageManager
org.python.core.CachedJarsPackageManager
org.python.core.PathPackageManager
- Direct Known Subclasses:
- SysPackageManager
- public abstract class PathPackageManager
- extends CachedJarsPackageManager
Path package manager. Gathering classes info dynamically
from a set of directories in path searchPath
, and
statically from a set of jars, like CachedJarsPackageManager
.
Method Summary |
void |
addClassPath(java.lang.String path)
Adds "classpath" entry. |
void |
addDirectory(java.io.File dir)
Add directory dir (if exists) to searchPath . |
PyList |
doDir(PyJavaPackage jpkg,
boolean instantiate,
boolean exclpkgs)
Reports the specified package content names. |
boolean |
packageExists(java.lang.String pkg,
java.lang.String name)
Dynamically check if pkg.name exists as java pkg in the
controlled hierarchy.
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
searchPath
public PyList searchPath
PathPackageManager
public PathPackageManager()
addDirectory
public void addDirectory(java.io.File dir)
- Add directory dir (if exists) to
searchPath
.
- Specified by:
addDirectory
in class PackageManager
- Parameters:
dir
- A directory.
addClassPath
public void addClassPath(java.lang.String path)
- Adds "classpath" entry. Calls
addDirectory(java.io.File)
if path
refers to a dir, CachedJarsPackageManager.addJarToPackages(java.io.File, boolean)
with param cache true if path refers to a jar.
doDir
public PyList doDir(PyJavaPackage jpkg,
boolean instantiate,
boolean exclpkgs)
- Description copied from class:
PackageManager
- Reports the specified package content names. Should be overriden.
Used by
PyJavaPackage.__dir__()
and
PyJavaPackage.fillDir()
.
- Specified by:
doDir
in class PackageManager
- Parameters:
jpkg
- queried packageinstantiate
- if true then instatiate reported names in
package dictexclpkgs
- exclude packages (just when instantiate is false)
- Returns:
- resulting list of names (PyList of PyString)
packageExists
public boolean packageExists(java.lang.String pkg,
java.lang.String name)
- Description copied from class:
PackageManager
- Dynamically check if pkg.name exists as java pkg in the
controlled hierarchy.
Should be overriden.
- Specified by:
packageExists
in class PackageManager
- Parameters:
pkg
- parent pkg namename
- candidate name
- Returns:
- true if pkg exists
Jython homepage