Pkg.JavaDecompiler
— API for decompiling Java Class files¶
Overview¶
The Pkg.JavaDecompiler
module contains the API for decompiling Java Class files.
Decompiling a Java Class¶
The following code example demonstrates how to decompile a Java Class file:
from Pkg.JavaDecompiler import *
def main():
dec = JavaDecompiler()
dec.init(r"file.class")
text, _ = dec.decompile()
if text != None:
print(text)
Module API¶
Pkg.JavaDecompiler module API.
Classes:
Java Class decompiler class.
- class JavaDecompiler¶
Java Class decompiler class.
Methods:
decompile
([language_version, wait_object])Decompiles a Java Class.
init
(file_name)Initializes the decompiler.
setIndentSize
(size)Sets the indentation size for decompiled code.
- decompile(language_version: Optional[str] = None, wait_object: Optional[Pro.Core.NTIWait] = None) → Tuple[Optional[str], Optional[Pro.Core.NTTextTags]]¶
Decompiles a Java Class.
- Parameters
language_version (Optional[str]) – Reserved parameter.
wait_object (Optional[NTIWait]) – An optional wait object.
- Returns
Returns a tuple containing the decompiled text and text tags if successful; otherwise returns a tuple whose first value is
None
.- Return type
Tuple[Optional[str], Optional[NTTextTags]]
See also
Pro.Core.NTTextTags
.
- init(file_name: str) → None¶
Initializes the decompiler.
- Parameters
file_name (str) – The name of the Java Class file to decompile.
See also
decompile()
.
- setIndentSize(size: int) → None¶
Sets the indentation size for decompiled code.
- Parameters
size (int) – The indent size.