Package com.ibm.wala.classLoader
Interface IMethod
-
- All Superinterfaces:
ContextItem,IClassHierarchyDweller,IMember
- All Known Subinterfaces:
IBytecodeMethod
- All Known Implementing Classes:
AbstractReflectionInterpreter.SpecializedMethod,AbstractRootMethod,ActivityModelMethod,AstCallGraph.AstFakeRoot,AstCallGraph.ScriptFakeRoot,AstMethod,CrossLanguageCallGraph.CrossLanguageFakeRoot,DexFakeRootMethod,DexIMethod,FactoryBypassInterpreter.SpecializedFactoryMethod,FakeRootMethod,FakeWorldClinitMethod,ShrikeBTMethod,ShrikeCTMethod,SummarizedMethod,SummarizedMethodWithNames,SyntheticMethod
public interface IMethod extends IMember, ContextItem
Basic interface for an object that represents a single Java method for analysis purposes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceIMethod.SourcePositionBEGIN Custom change: precise positions-
Nested classes/interfaces inherited from interface com.ibm.wala.ipa.callgraph.ContextItem
ContextItem.Value<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TypeReference[]getDeclaredExceptions()DescriptorgetDescriptor()something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;intgetLineNumber(int bcIndex)StringgetLocalVariableName(int bcIndex, int localNumber)intgetNumberOfParameters()Method getNumberOfParameters.IMethod.SourcePositiongetParameterSourcePosition(int paramNum)TypeReferencegetParameterType(int i)By convention, for a non-static method, getParameterType(0) is the this pointerMethodReferencegetReference()TypeReferencegetReturnType()SelectorgetSelector()something like: foo(Ljava/langString;)Ljava/lang/Class;StringgetSignature()something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;IMethod.SourcePositiongetSourcePosition(int instructionIndex)booleanhasExceptionHandler()booleanhasLocalVariableTable()booleanisAbstract()Is this method abstract?booleanisBridge()Is this method a bridge method? See JLS 3rd Edition 15.12.4.5booleanisClinit()Is this method a class initializer?booleanisFinal()Is this method final?booleanisInit()Is this method an object initializer?booleanisNative()Is this method native?booleanisPrivate()Is this method private?booleanisProtected()Is this method protected?booleanisPublic()Is this method public?booleanisSynchronized()Is this method synchronized?booleanisSynthetic()Did someone synthesize this method? (As opposed to reading it from a class file)-
Methods inherited from interface com.ibm.wala.ipa.cha.IClassHierarchyDweller
getClassHierarchy
-
Methods inherited from interface com.ibm.wala.classLoader.IMember
getAnnotations, getDeclaringClass, getName, isStatic
-
-
-
-
Method Detail
-
isSynchronized
boolean isSynchronized()
Is this method synchronized?
-
isClinit
boolean isClinit()
Is this method a class initializer?
-
isInit
boolean isInit()
Is this method an object initializer?
-
isNative
boolean isNative()
Is this method native?
-
isSynthetic
boolean isSynthetic()
Did someone synthesize this method? (As opposed to reading it from a class file)
-
isAbstract
boolean isAbstract()
Is this method abstract?
-
isPrivate
boolean isPrivate()
Is this method private?
-
isProtected
boolean isProtected()
Is this method protected?
-
isPublic
boolean isPublic()
Is this method public?
-
isFinal
boolean isFinal()
Is this method final?
-
isBridge
boolean isBridge()
Is this method a bridge method? See JLS 3rd Edition 15.12.4.5
-
getReference
MethodReference getReference()
- Returns:
- canonical MethodReference corresponding to this method
-
hasExceptionHandler
boolean hasExceptionHandler()
- Returns:
- true iff this method has at least one exception handler
-
getParameterType
TypeReference getParameterType(int i)
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, UnsupportedOperationException
- Returns:
- an array of the exception types declared by the throws clause for this method, or null if there are none
- Throws:
InvalidClassFileExceptionUnsupportedOperationException
-
getLineNumber
int getLineNumber(int bcIndex)
- Returns:
- the source line number corresponding to a particular bytecode index, or -1 if the information is not available.
-
getSourcePosition
IMethod.SourcePosition getSourcePosition(int instructionIndex) throws InvalidClassFileException
- Throws:
InvalidClassFileException
-
getParameterSourcePosition
IMethod.SourcePosition getParameterSourcePosition(int paramNum) throws InvalidClassFileException
- Throws:
InvalidClassFileException
-
getLocalVariableName
String getLocalVariableName(int bcIndex, int localNumber)
- 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.
-
getSignature
String getSignature()
something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;
-
getSelector
Selector getSelector()
something like: foo(Ljava/langString;)Ljava/lang/Class;
-
getDescriptor
Descriptor getDescriptor()
something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;
-
hasLocalVariableTable
boolean hasLocalVariableTable()
- Returns:
- true iff the local variable table information for this method is available
-
-