com.ibm.wala.classLoader
Interface IMethod

All Superinterfaces:
ContextItem, IClassHierarchyDweller, IMember
All Known Implementing Classes:
AbstractRootMethod, AstCallGraph.AstFakeRoot, AstCallGraph.ScriptFakeRoot, AstMethod, CommandInterpreter.SpecializedExecuteMethod, CrossLanguageCallGraph.CrossLanguageFakeRoot, FactoryBypassInterpreter.SpecializedFactoryMethod, FakeRootMethod, FakeWorldClinitMethod, JavaScriptLoader.JavaScriptMethodObject, JavaScriptSummarizedFunction, JavaSourceLoaderImpl.ConcreteJavaMethod, JSCallGraph.JSFakeRoot, ShrikeBTMethod, ShrikeCTMethod, SummarizedEJBMethod, SummarizedMethod, SyntheticMethod

public interface IMethod
extends IMember, ContextItem

Basic interface for an object that represents a single Java method for analysis purposes.


Method Summary
 TypeReference[] getDeclaredExceptions()
           
 Descriptor getDescriptor()
          Method getDescriptor.
 int getLineNumber(int bcIndex)
           
 java.lang.String getLocalVariableName(int bcIndex, int localNumber)
           
 int getMaxLocals()
           
 int getMaxStackHeight()
           
 int getNumberOfParameters()
          Method getNumberOfParameters.
 TypeReference getParameterType(int i)
          Method getParameterType.
 MethodReference getReference()
           
 TypeReference getReturnType()
           
 Selector getSelector()
          something like: foo(Ljava/langString;)Ljava/lang/Class;
 java.lang.String getSignature()
          something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;
 boolean hasExceptionHandler()
           
 boolean hasLocalVariableTable()
           
 boolean isAbstract()
          Is this method abstract?
 boolean isClinit()
          Is this method a class initializer?
 boolean isFinal()
          Is this method final?
 boolean isInit()
          Is this method an object initializer?
 boolean isNative()
          Is this method native?
 boolean isPrivate()
          Is this method private?
 boolean isProtected()
          Is this method protected?
 boolean isPublic()
          Is this method public?
 boolean isSynchronized()
          Is this method synchronized?
 boolean isSynthetic()
          Did someone synthesize this method? (As opposed to reading it from a class file)
 
Methods inherited from interface com.ibm.wala.classLoader.IMember
getDeclaringClass, getName, isStatic, isVolatile
 
Methods inherited from interface com.ibm.wala.ipa.cha.IClassHierarchyDweller
getClassHierarchy
 

Method Detail

isSynchronized

boolean isSynchronized()
Is this method synchronized?

Returns:
boolean

isClinit

boolean isClinit()
Is this method a class initializer?

Returns:
boolean

isInit

boolean isInit()
Is this method an object initializer?

Returns:
boolean

isNative

boolean isNative()
Is this method native?

Returns:
boolean

isSynthetic

boolean isSynthetic()
Did someone synthesize this method? (As opposed to reading it from a class file)

Returns:
boolean

isAbstract

boolean isAbstract()
Is this method abstract?

Returns:
boolean

isPrivate

boolean isPrivate()
Is this method private?

Returns:
boolean

isProtected

boolean isProtected()
Is this method protected?

Returns:
boolean

isPublic

boolean isPublic()
Is this method public?

Returns:
boolean

isFinal

boolean isFinal()
Is this method final?

Returns:
boolean

getReference

MethodReference getReference()
Returns:
canonical MethodReference corresponding to this method

getMaxLocals

int getMaxLocals()
Returns:
maximum number of JVM locals used by this method

getMaxStackHeight

int getMaxStackHeight()
Returns:
maximum height of JVM stack used by this method

hasExceptionHandler

boolean hasExceptionHandler()
Returns:
true iff this method has at least one exception handler

getParameterType

TypeReference getParameterType(int i)
Method getParameterType. By convention, for a non-static method, getParameterType(0) is the this pointer


getReturnType

TypeReference getReturnType()
Returns:
the name of the return type for this method

getNumberOfParameters

int getNumberOfParameters()
Method getNumberOfParameters. This result includes the "this" pointer if applicable


getDeclaredExceptions

TypeReference[] getDeclaredExceptions()
                                      throws InvalidClassFileException
Returns:
an array of the exception types declared by the throws clause for this method, or null if there are none
Throws:
InvalidClassFileException

getLineNumber

int getLineNumber(int bcIndex)
                  throws InvalidClassFileException
Returns:
the source line number corresponding to a particular bytecode index, or -1 if the information is not available.
Throws:
InvalidClassFileException

getLocalVariableName

java.lang.String getLocalVariableName(int bcIndex,
                                      int localNumber)
                                      throws InvalidClassFileException
Returns:
the (source code) name of the local variable of a given number at the specified program counter, or null if the information is not available.
Throws:
InvalidClassFileException

getSignature

java.lang.String getSignature()
something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;

Returns:
String

getSelector

Selector getSelector()
something like: foo(Ljava/langString;)Ljava/lang/Class;

Returns:
String

getDescriptor

Descriptor getDescriptor()
Method getDescriptor. something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;

Returns:
Descriptor

hasLocalVariableTable

boolean hasLocalVariableTable()
Returns:
true iff the local variable table information for this method is available