Package org.python.core.packagecache
Class PathPackageManager
java.lang.Object
org.python.core.packagecache.PackageManager
org.python.core.packagecache.CachedJarsPackageManager
org.python.core.packagecache.PathPackageManager
- Direct Known Subclasses:
SysPackageManager
Path package manager. Gathering classes info dynamically from a set of directories in path
searchPath
, and statically from a set of jars, like CachedJarsPackageManager
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.python.core.packagecache.CachedJarsPackageManager
CachedJarsPackageManager.JarXEntry
-
Field Summary
Fields inherited from class org.python.core.packagecache.PackageManager
topLevelPackage
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addClassPath
(String path) Scan a Java class-path that may be a mixture of directory and JAR specifiers, and within each path entry index the packages.void
addDirectory
(File dir) Add directory dir (if exists) tosearchPath
.doDir
(PyJavaPackage jpkg, boolean instantiate, boolean exclpkgs) Reports the specified package content names.boolean
packageExists
(String pkg, String name) Dynamically check if pkg.name exists as java pkg in the controlled hierarchy.Methods inherited from class org.python.core.packagecache.CachedJarsPackageManager
addJarToPackages, addJarToPackages, addJarToPackages, addJarToPackages, saveCache
Methods inherited from class org.python.core.packagecache.PackageManager
addJar, addJarDir, findClass, findClass, lookupName, makeJavaPackage, notifyPackageImport
-
Field Details
-
searchPath
-
-
Constructor Details
-
PathPackageManager
public PathPackageManager()
-
-
Method Details
-
addDirectory
Add directory dir (if exists) tosearchPath
.- Specified by:
addDirectory
in classPackageManager
- Parameters:
dir
- A directory.
-
addClassPath
Scan a Java class-path that may be a mixture of directory and JAR specifiers, and within each path entry index the packages. CallsaddDirectory(java.io.File)
if a path entry refers to a dir,CachedJarsPackageManager.addJarToPackages(java.io.File, boolean)
with param cache true if the path entry refers to a jar. -
doDir
Description copied from class:PackageManager
Reports the specified package content names. Should be overridden. Used byPyJavaPackage.__dir__()
andPyJavaPackage.fillDir()
.- Specified by:
doDir
in classPackageManager
- 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
Description copied from class:PackageManager
Dynamically check if pkg.name exists as java pkg in the controlled hierarchy. Should be overridden.- Specified by:
packageExists
in classPackageManager
- Parameters:
pkg
- parent pkg namename
- candidate name- Returns:
- true if pkg exists
-