public class Method extends NonStatement
This AST element represents a Java method.
Retrieve a Method element using JebInstance.getDecompiledMethodTree
.
Methods can be created via the use of a Method.Builder
.
Note: Currently, methods are read-only elements.
Class
Modifier and Type | Class and Description |
---|---|
static class |
Method.Builder
This class is used to generate AST
Method elements. |
Modifier and Type | Method and Description |
---|---|
Block |
getBody()
Get the body of the method.
|
Class |
getContainingClass()
Get a reference to the containing class AST element.
|
java.lang.String |
getName()
Get the method name.
|
java.util.List<Definition> |
getParameters()
Get the parameters of the method.
|
java.lang.String |
getSignature()
Get the method signature.
|
boolean |
isStatic()
Determine whether the method is a static method.
|
boolean |
renameIdentifier(JebInstance jeb,
Identifier ident,
java.lang.String new_name)
Rename the identifier of a method, and update the JEB database accordingly.
|
static Method |
w(java.lang.Object object)
Internal method, do not use.
|
attachTag, getSubElements, replaceSubElement, retrieveTag
public static Method w(java.lang.Object object)
Internal method, do not use.
object
- opaque Method datapublic java.lang.String getName()
Get the method name.
public java.lang.String getSignature()
Get the method signature.
Format: classSignature->methodName(paramTypes)returnType
public java.util.List<Definition> getParameters()
Get the parameters of the method.
public Block getBody()
Get the body of the method.
public Class getContainingClass()
Get a reference to the containing class AST element.
public boolean isStatic()
Determine whether the method is a static method.
public boolean renameIdentifier(JebInstance jeb, Identifier ident, java.lang.String new_name)
Rename the identifier of a method, and update the JEB database accordingly.
Note that this method does not refresh views (such as the text window of JEB UI). Associated decompiled code views, if any, should be refreshed by the caller.
jeb
- the current JebInstance object, cannot be nullident
- the identifier to be renamed, cannot be nullnew_name
- the new name for the identifier. An empty or null string indicates that the original name should be set back