Class PyJavaPackage

    • Field Detail

      • __name__

        public java.lang.String __name__
      • clsSet

        public PyStringMap clsSet
        Its keys are the names of statically known classes. E.g. from jars pre-scan.
      • __file__

        public java.lang.String __file__
      • __mgr__

        public PackageManager __mgr__
        (Control) package manager whose hierarchy contains this java pkg
    • Constructor Detail

      • PyJavaPackage

        public PyJavaPackage​(java.lang.String name)
      • PyJavaPackage

        public PyJavaPackage​(java.lang.String name,
                             java.lang.String jarfile)
      • PyJavaPackage

        public PyJavaPackage​(java.lang.String name,
                             PackageManager mgr)
      • PyJavaPackage

        public PyJavaPackage​(java.lang.String name,
                             PackageManager mgr,
                             java.lang.String jarfile)
    • Method Detail

      • addPackage

        public PyJavaPackage addPackage​(java.lang.String name)
      • addPackage

        public PyJavaPackage addPackage​(java.lang.String name,
                                        java.lang.String jarfile)
        From a dotted package name a.b.c interpreted relative to this package t, ensure that a is in the dictionary of t and then recursively process the remainder b.c relative to a, finally returning the PyJavaPackage(java.lang.String, org.python.core.packagecache.PackageManager, java.lang.String) of t.a.b.c. In the case where the initial package name is just a, no dots, the method simply ensures a is entered in t, and returns the PyJavaPackage of t.a.
        Parameters:
        name - a package name
        jarfile - becomes the __file__ attribute
        Returns:
        the PyJavaPackage of the package named
      • addClass

        public PyObject addClass​(java.lang.String name,
                                 java.lang.Class<?> c)
      • addPlaceholders

        public void addPlaceholders​(java.util.Collection<java.lang.String> classes)
        Add the classes named to this package, but with only a placeholder value. These names are statically known, typically from processing JAR files on the class path.
        Parameters:
        classes - the names as strings
      • __dir__

        public PyObject __dir__()
        Description copied from class: PyObject
        Equivalent to the standard Python __dir__ method.
        Overrides:
        __dir__ in class PyObject
        Returns:
        a list of names defined by this object.
      • __findattr_ex__

        public PyObject __findattr_ex__​(java.lang.String name)
        Description copied from class: PyObject
        Attribute lookup hook. If the attribute is not found, null may be returned or a Py.AttributeError can be thrown, whatever is more correct, efficient and/or convenient for the implementing class. Client code should use PyObject.__getattr__(String) or PyObject.__findattr__(String). Both methods have a clear policy for failed lookups.
        Overrides:
        __findattr_ex__ in class PyObject
        Returns:
        The looked up value. May return null if the attribute is not found
      • __setattr__

        public void __setattr__​(java.lang.String attr,
                                PyObject value)
        Description copied from class: PyObject
        A variant of the __setattr__ method which accepts a String as the key. This String must be interned.
        Overrides:
        __setattr__ in class PyObject
        Parameters:
        attr - the name whose value will be set - must be an interned string .
        value - the value to set this name to
        See Also:
        PyObject.__setattr__(PyString, PyObject)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class PyObject