Package com.ibm.wala.cast.loader
Class AstMethod
- java.lang.Object
-
- com.ibm.wala.cast.loader.AstMethod
-
- All Implemented Interfaces:
IMember,IMethod,ContextItem,IClassHierarchyDweller
public abstract class AstMethod extends Object implements IMethod
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAstMethod.DebuggingInformationstatic interfaceAstMethod.LexicalInformationlexical access information for some entity scope.static classAstMethod.LexicalParentParents of this method with respect to lexical scoping, that is, methods containing state possibly referenced lexically in this methodstatic interfaceAstMethod.Retranslatable-
Nested classes/interfaces inherited from interface com.ibm.wala.ipa.callgraph.ContextItem
ContextItem.Value<T>
-
Nested classes/interfaces inherited from interface com.ibm.wala.classLoader.IMethod
IMethod.SourcePosition
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAstMethod(IClass cls, Collection qualifiers, AbstractCFG cfg, SymbolTable symtab, MethodReference ref, boolean hasCatchBlock, Map<IBasicBlock,TypeReference[]> caughtTypes, boolean hasMonitorOp, AstTranslator.AstLexicalInformation lexicalInfo, AstMethod.DebuggingInformation debugInfo, Collection<Annotation> annotations)protectedAstMethod(IClass cls, Collection qualifiers, MethodReference ref, Collection<Annotation> annotations)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Map<IBasicBlock,TypeReference[]>catchTypes()AbstractCFGcfg()AstMethod.LexicalInformationcloneLexicalInfo()AstMethod.DebuggingInformationdebugInfo()Collection<Annotation>getAnnotations()Get the annotations on this member, if anyControlFlowGraphgetControlFlowGraph()IClassgetDeclaringClass()Return the object that represents the declaring class for this member.DescriptorgetDescriptor()something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;intgetLineNumber(int instructionIndex)END Custom change: precise bytecode positionsAtomgetName()intgetNumberOfParameters()Method getNumberOfParameters.IMethod.SourcePositiongetParameterSourcePosition(int paramNum)BEGIN Custom change: precise bytecode positionsabstract AstMethod.LexicalParent[]getParents()MethodReferencegetReference()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;CAstSourcePositionMap.PositiongetSourcePosition()CAstSourcePositionMap.PositiongetSourcePosition(int instructionIndex)booleanhasCatchBlock()booleanhasExceptionHandler()booleanhasMonitorOp()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?booleanisStatic()Is this member static?booleanisSynchronized()Is this method synchronized?booleanisSynthetic()Did someone synthesize this method? (As opposed to reading it from a class file)AstMethod.LexicalInformationlexicalInfo()SymbolTablesymbolTable()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.wala.ipa.cha.IClassHierarchyDweller
getClassHierarchy
-
Methods inherited from interface com.ibm.wala.classLoader.IMethod
getDeclaredExceptions, getLocalVariableName, getParameterType, hasLocalVariableTable
-
-
-
-
Field Detail
-
cls
protected final IClass cls
-
-
Constructor Detail
-
AstMethod
protected AstMethod(IClass cls, Collection qualifiers, AbstractCFG cfg, SymbolTable symtab, MethodReference ref, boolean hasCatchBlock, Map<IBasicBlock,TypeReference[]> caughtTypes, boolean hasMonitorOp, AstTranslator.AstLexicalInformation lexicalInfo, AstMethod.DebuggingInformation debugInfo, Collection<Annotation> annotations)
-
AstMethod
protected AstMethod(IClass cls, Collection qualifiers, MethodReference ref, Collection<Annotation> annotations)
-
-
Method Detail
-
cfg
public AbstractCFG cfg()
-
hasCatchBlock
public boolean hasCatchBlock()
-
symbolTable
public SymbolTable symbolTable()
-
catchTypes
public Map<IBasicBlock,TypeReference[]> catchTypes()
-
cloneLexicalInfo
public AstMethod.LexicalInformation cloneLexicalInfo()
-
lexicalInfo
public AstMethod.LexicalInformation lexicalInfo()
-
debugInfo
public AstMethod.DebuggingInformation debugInfo()
-
getAnnotations
public Collection<Annotation> getAnnotations()
Description copied from interface:IMemberGet the annotations on this member, if any- Specified by:
getAnnotationsin interfaceIMember
-
getParents
public abstract AstMethod.LexicalParent[] getParents()
-
getDeclaringClass
public IClass getDeclaringClass()
Description copied from interface:IMemberReturn the object that represents the declaring class for this member.- Specified by:
getDeclaringClassin interfaceIMember- Returns:
- the object that represents the declaring class for this member.
-
getSignature
public String getSignature()
Description copied from interface:IMethodsomething like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;- Specified by:
getSignaturein interfaceIMethod
-
getSelector
public Selector getSelector()
Description copied from interface:IMethodsomething like: foo(Ljava/langString;)Ljava/lang/Class;- Specified by:
getSelectorin interfaceIMethod
-
isClinit
public boolean isClinit()
Description copied from interface:IMethodIs this method a class initializer?
-
isInit
public boolean isInit()
Description copied from interface:IMethodIs this method an object initializer?
-
getName
public Atom getName()
-
getDescriptor
public Descriptor getDescriptor()
Description copied from interface:IMethodsomething like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;- Specified by:
getDescriptorin interfaceIMethod
-
getReference
public MethodReference getReference()
- Specified by:
getReferencein interfaceIMethod- Returns:
- canonical MethodReference corresponding to this method
-
getReturnType
public TypeReference getReturnType()
- Specified by:
getReturnTypein interfaceIMethod- Returns:
- the name of the return type for this method
-
isStatic
public boolean isStatic()
Description copied from interface:IMemberIs this member static?
-
isSynchronized
public boolean isSynchronized()
Description copied from interface:IMethodIs this method synchronized?- Specified by:
isSynchronizedin interfaceIMethod
-
isNative
public boolean isNative()
Description copied from interface:IMethodIs this method native?
-
isSynthetic
public boolean isSynthetic()
Description copied from interface:IMethodDid someone synthesize this method? (As opposed to reading it from a class file)- Specified by:
isSyntheticin interfaceIMethod
-
isAbstract
public boolean isAbstract()
Description copied from interface:IMethodIs this method abstract?- Specified by:
isAbstractin interfaceIMethod
-
isPrivate
public boolean isPrivate()
Description copied from interface:IMethodIs this method private?
-
isProtected
public boolean isProtected()
Description copied from interface:IMethodIs this method protected?- Specified by:
isProtectedin interfaceIMethod
-
isPublic
public boolean isPublic()
Description copied from interface:IMethodIs this method public?
-
isFinal
public boolean isFinal()
Description copied from interface:IMethodIs this method final?
-
isBridge
public boolean isBridge()
Description copied from interface:IMethodIs this method a bridge method? See JLS 3rd Edition 15.12.4.5
-
getControlFlowGraph
public ControlFlowGraph getControlFlowGraph()
-
hasExceptionHandler
public boolean hasExceptionHandler()
- Specified by:
hasExceptionHandlerin interfaceIMethod- Returns:
- true iff this method has at least one exception handler
-
hasMonitorOp
public boolean hasMonitorOp()
-
getNumberOfParameters
public int getNumberOfParameters()
Description copied from interface:IMethodMethod getNumberOfParameters. This result includes the "this" pointer if applicable- Specified by:
getNumberOfParametersin interfaceIMethod
-
getParameterSourcePosition
public IMethod.SourcePosition getParameterSourcePosition(int paramNum) throws InvalidClassFileException
BEGIN Custom change: precise bytecode positions- Specified by:
getParameterSourcePositionin interfaceIMethod- Throws:
InvalidClassFileException
-
getLineNumber
public int getLineNumber(int instructionIndex)
END Custom change: precise bytecode positions- Specified by:
getLineNumberin interfaceIMethod- Returns:
- the source line number corresponding to a particular bytecode index, or -1 if the information is not available.
-
getSourcePosition
public CAstSourcePositionMap.Position getSourcePosition()
-
getSourcePosition
public CAstSourcePositionMap.Position getSourcePosition(int instructionIndex)
- Specified by:
getSourcePositionin interfaceIMethod
-
-