pyscalpel.java
This module declares type definitions used for Java objects.
If you are a normal user, you should probably never have to manipulate these objects yourself.
1""" 2 This module declares type definitions used for Java objects. 3 4 If you are a normal user, you should probably never have to manipulate these objects yourself. 5""" 6from .bytes import JavaBytes 7from .import_java import import_java 8from .object import JavaClass, JavaObject 9from . import burp 10from . import scalpel_types 11 12__all__ = [ 13 "burp", 14 "scalpel_types", 15 "import_java", 16 "JavaObject", 17 "JavaBytes", 18 "JavaClass", 19]
def
import_java( module: str, name: str, expected_type: Type[~ExpectedObject] = <class 'JavaObject'>) -> ~ExpectedObject:
19def import_java( 20 module: str, name: str, expected_type: Type[ExpectedObject] = JavaObject 21) -> ExpectedObject: 22 """Import a Java class using Python's import mechanism. 23 24 :param module: The module to import from. (e.g. "java.lang") 25 :param name: The name of the class to import. (e.g. "String") 26 :param expected_type: The expected type of the class. (e.g. JavaObject) 27 :return: The imported class. 28 """ 29 if _is_pdoc() or os.environ.get("_DO_NOT_IMPORT_JAVA") is not None: 30 return None # type: ignore 31 try: # pragma: no cover 32 module = __import__(module, fromlist=[name]) 33 return getattr(module, name) 34 except ImportError as exc: # pragma: no cover 35 raise ImportError(f"Could not import Java class {name}") from exc
class
JavaObject(typing.Protocol):
10class JavaObject(Protocol, metaclass=ABCMeta): 11 """generated source for class Object""" 12 13 @abstractmethod 14 def __init__(self): 15 """generated source for method __init__""" 16 17 @abstractmethod 18 def getClass(self) -> JavaClass: 19 """generated source for method getClass""" 20 21 @abstractmethod 22 def hashCode(self) -> int: 23 """generated source for method hashCode""" 24 25 @abstractmethod 26 def equals(self, obj) -> bool: 27 """generated source for method equals""" 28 29 @abstractmethod 30 def clone(self) -> JavaObject: 31 """generated source for method clone""" 32 33 @abstractmethod 34 def __str__(self) -> str: 35 """generated source for method toString""" 36 37 @abstractmethod 38 def notify(self) -> None: 39 """generated source for method notify""" 40 41 @abstractmethod 42 def notifyAll(self) -> None: 43 """generated source for method notifyAll""" 44 45 @abstractmethod 46 @overload 47 def wait(self) -> None: 48 """generated source for method wait""" 49 50 @abstractmethod 51 @overload 52 def wait(self, arg0: int) -> None: 53 """generated source for method wait_0""" 54 55 @abstractmethod 56 @overload 57 def wait(self, timeoutMillis: int, nanos: int) -> None: 58 """generated source for method wait_1""" 59 60 @abstractmethod 61 def finalize(self) -> None: 62 """generated source for method finalize"""
generated source for class Object
17 @abstractmethod 18 def getClass(self) -> JavaClass: 19 """generated source for method getClass"""
generated source for method getClass
def
wait(*args, **kwds):
2010def _overload_dummy(*args, **kwds): 2011 """Helper for @overload to raise when called.""" 2012 raise NotImplementedError( 2013 "You should not call an overloaded function. " 2014 "A series of @overload-decorated functions " 2015 "outside a stub module should always be followed " 2016 "by an implementation that is not @overload-ed.")
Helper for @overload to raise when called.
class
JavaBytes(list[int]):
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
Inherited Members
- builtins.list
- list
- clear
- copy
- append
- insert
- extend
- pop
- remove
- index
- count
- reverse
- sort
generated source for class Object