public interface

IJavaMethod

implements IJavaDecompilableElement
com.pnfsoftware.jeb.core.units.code.java.IJavaMethod

Class Overview

Java AST interface to represent a Java method.

Summary

[Expand]
Inherited Constants
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
Public Methods
abstract boolean deleteStatement(IJavaStatement stm)
Delete a statement by reference.
abstract IJavaMethod duplicate()
Duplicate this element.
abstract void fromFlatList(List<IJavaStatement> list)
abstract void generate(JavaOutputSink out, int genkind)
abstract void generate(JavaOutputSink out, boolean bodyOnly)
abstract int getAccessFlags()
abstract List<String> getAnonymousClassSignatures()
abstract List<IJavaClass> getAnonymousClasses()
abstract IJavaBlock getBody()
Get the body of the method.
abstract IJavaType getClassType()
Get the type of the entity containing this method.
abstract IJavaExpression getDefaultValue()
Get the default value provided by this method if there is one.
abstract IJavaIdentifierManager getIdentifierManager()
abstract int getIndexOfFirstVisibleParameter()
abstract List<String> getInnerClassSignatures()
abstract List<IJavaClass> getInnerClasses()
abstract IJavaLabelFactory getLabelFactory()
abstract List<IJavaAnnotation> getMethodAnnotations()
abstract String getName()
Get the original method name.
abstract IJavaDefinition getParameter(int index)
abstract List<IJavaAnnotation> getParameterAnnotations(int index)
abstract int getParameterCount()
abstract List<IJavaDefinition> getParameters()
Get the parameters of the method.
abstract IJavaType getReturnType()
Get the return type of the method.
abstract String getSignature()
Get the original method signature.
abstract List<IJavaStatement> getStatements()
Walk the tree and get the ordered list of all (non-pseudo) statements that make up the method.
abstract int getVisibleParameterCount()
abstract List<IJavaDefinition> getVisibleParameters()
abstract boolean isAbstract()
abstract boolean isClassConstructor()
abstract boolean isClassInitializer()
abstract boolean isConstructor()
abstract boolean isEmpty()
abstract boolean isInner()
abstract boolean isNative()
abstract boolean isPrivate()
abstract boolean isProtected()
abstract boolean isPublic()
abstract boolean isSecondParameterOuterClassReference()
abstract boolean isStatic()
Determine whether this method is a static method.
abstract boolean isSynthetic()
abstract void markSecondParameterOuterClassReference()
abstract void setDefaultValue(IJavaExpression defaultValue)
abstract void setIndexOfFirstVisibleParameter(int index)
abstract List<IJavaStatement> toFlatList()
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaDecompilableElement
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement

Public Methods

public abstract boolean deleteStatement (IJavaStatement stm)

Delete a statement by reference. This method performs a deep search within the entire method. This works because no method should contain the same statement (in the sense, same reference) twice.

Parameters
stm the statement to delete
Returns
  • true if the statement was found and deleted

public abstract IJavaMethod duplicate ()

Duplicate this element.

Returns
  • a (possibly) duplicated object of the same type

public abstract void fromFlatList (List<IJavaStatement> list)

public abstract void generate (JavaOutputSink out, int genkind)

Parameters
genkind 0= regular method; 1= just the body of the method; 2= the method is a lambda

public abstract void generate (JavaOutputSink out, boolean bodyOnly)

public abstract int getAccessFlags ()

public abstract List<String> getAnonymousClassSignatures ()

public abstract List<IJavaClass> getAnonymousClasses ()

public abstract IJavaBlock getBody ()

Get the body of the method.

Returns
  • the body, null if none

public abstract IJavaType getClassType ()

Get the type of the entity containing this method.

public abstract IJavaExpression getDefaultValue ()

Get the default value provided by this method if there is one.

Returns
  • a default value or null

public abstract IJavaIdentifierManager getIdentifierManager ()

public abstract int getIndexOfFirstVisibleParameter ()

public abstract List<String> getInnerClassSignatures ()

public abstract List<IJavaClass> getInnerClasses ()

public abstract IJavaLabelFactory getLabelFactory ()

public abstract List<IJavaAnnotation> getMethodAnnotations ()

public abstract String getName ()

Get the original method name. The returned name is a simple name, without parameter, return, or type information.

Returns
  • the method name

public abstract IJavaDefinition getParameter (int index)

public abstract List<IJavaAnnotation> getParameterAnnotations (int index)

public abstract int getParameterCount ()

public abstract List<IJavaDefinition> getParameters ()

Get the parameters of the method.

Note: If the method is non-static, the first parameter in the list would be `this`.

Returns
  • the list of parameters

public abstract IJavaType getReturnType ()

Get the return type of the method.

Returns
  • the return type

public abstract String getSignature ()

Get the original method signature.

Returns
  • the method signature

public abstract List<IJavaStatement> getStatements ()

Walk the tree and get the ordered list of all (non-pseudo) statements that make up the method.

public abstract int getVisibleParameterCount ()

public abstract List<IJavaDefinition> getVisibleParameters ()

public abstract boolean isAbstract ()

public abstract boolean isClassConstructor ()

public abstract boolean isClassInitializer ()

public abstract boolean isConstructor ()

public abstract boolean isEmpty ()

public abstract boolean isInner ()

public abstract boolean isNative ()

public abstract boolean isPrivate ()

public abstract boolean isProtected ()

public abstract boolean isPublic ()

public abstract boolean isSecondParameterOuterClassReference ()

public abstract boolean isStatic ()

Determine whether this method is a static method.

Returns
  • true if the method is static, false otherwise (virtual method)

public abstract boolean isSynthetic ()

public abstract void markSecondParameterOuterClassReference ()

public abstract void setDefaultValue (IJavaExpression defaultValue)

public abstract void setIndexOfFirstVisibleParameter (int index)

public abstract List<IJavaStatement> toFlatList ()