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
FieldsFields inherited from class org.python.core.packagecache.PackageManager
topLevelPackage -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClassPath(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.voidaddDirectory(File dir) Add directory dir (if exists) tosearchPath.doDir(PyJavaPackage jpkg, boolean instantiate, boolean exclpkgs) Reports the specified package content names.booleanpackageExists(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, saveCacheMethods 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:
addDirectoryin 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:PackageManagerReports the specified package content names. Should be overridden. Used byPyJavaPackage.__dir__()andPyJavaPackage.fillDir().- Specified by:
doDirin 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:PackageManagerDynamically check if pkg.name exists as java pkg in the controlled hierarchy. Should be overridden.- Specified by:
packageExistsin classPackageManager- Parameters:
pkg- parent pkg namename- candidate name- Returns:
- true if pkg exists
-