Interface IMethod
- All Superinterfaces:
ContextItem
,IClassHierarchyDweller
,IMember
- All Known Subinterfaces:
IBytecodeMethod<I>
- All Known Implementing Classes:
AbstractReflectionInterpreter.SpecializedMethod
,AbstractRootMethod
,AstCallGraph.AstFakeRoot
,AstCallGraph.ScriptFakeRoot
,AstMethod
,CAstAbstractModuleLoader.DynamicMethodObject
,CrossLanguageCallGraph.CrossLanguageFakeRoot
,DexIMethod
,FactoryBypassInterpreter.SpecializedFactoryMethod
,FakeRootMethod
,FakeWorldClinitMethod
,JavaScriptConstructorFunctions.JavaScriptConstructor
,JavaScriptSummarizedFunction
,JavaSourceLoaderImpl.AbstractJavaMethod
,JavaSourceLoaderImpl.ConcreteJavaMethod
,JavaSourceLoaderImpl.JavaEntityMethod
,JSCallGraph.JSFakeRoot
,ShrikeBTMethod
,ShrikeCTMethod
,SummarizedMethod
,SummarizedMethodWithNames
,SyntheticMethod
Basic interface for an object that represents a single Java method for analysis purposes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ibm.wala.ipa.callgraph.ContextItem
ContextItem.Value<T>
-
Method Summary
Modifier and TypeMethodDescriptionsomething like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;int
getLineNumber
(int bcIndex) getLocalVariableName
(int bcIndex, int localNumber) default int
int
Method getNumberOfParameters.getParameterSourcePosition
(int paramNum) getParameterType
(int i) By convention, for a non-static method, getParameterType(0) is the this pointersomething like: foo(Ljava/langString;)Ljava/lang/Class;something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;getSourcePosition
(int instructionIndex) boolean
boolean
boolean
Is this method abstract?boolean
boolean
isBridge()
Is this method a bridge method? See JLS 3rd Edition 15.12.4.5boolean
isClinit()
Is this method a class initializer?boolean
isEnum()
boolean
isFinal()
Is this method final?boolean
isInit()
Is this method an object initializer?boolean
isModule()
boolean
isNative()
Is this method native?boolean
Is this method private?boolean
Is this method protected?boolean
isPublic()
Is this method public?boolean
Is this method synchronized?boolean
Is this method synthetic, i.e., compiler-generated (this refers to the synthetic flag in java/dex bytecode)boolean
Is the implementation of this method a model generated by WALA? For compiler-generated synthetic methods, refer toisSynthetic()
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 Details
-
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? -
isWalaSynthetic
boolean isWalaSynthetic()Is the implementation of this method a model generated by WALA? For compiler-generated synthetic methods, refer toisSynthetic()
-
isSynthetic
boolean isSynthetic()Is this method synthetic, i.e., compiler-generated (this refers to the synthetic flag in java/dex bytecode) -
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
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:
InvalidClassFileException
UnsupportedOperationException
-
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
- Throws:
InvalidClassFileException
-
getParameterSourcePosition
- Throws:
InvalidClassFileException
-
getLocalVariableName
- 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
-
getNumberOfDefaultParameters
default int getNumberOfDefaultParameters() -
isAnnotation
boolean isAnnotation() -
isEnum
boolean isEnum() -
isModule
boolean isModule()
-