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 interface
AstMethod.DebuggingInformation
static interface
AstMethod.LexicalInformation
lexical access information for some entity scope.static class
AstMethod.LexicalParent
Parents of this method with respect to lexical scoping, that is, methods containing state possibly referenced lexically in this methodstatic interface
AstMethod.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 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)
protected
AstMethod(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()
AbstractCFG
cfg()
AstMethod.LexicalInformation
cloneLexicalInfo()
AstMethod.DebuggingInformation
debugInfo()
Collection<Annotation>
getAnnotations()
Get the annotations on this member, if anyControlFlowGraph
getControlFlowGraph()
IClass
getDeclaringClass()
Return the object that represents the declaring class for this member.Descriptor
getDescriptor()
something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;int
getLineNumber(int instructionIndex)
END Custom change: precise bytecode positionsAtom
getName()
int
getNumberOfParameters()
Method getNumberOfParameters.IMethod.SourcePosition
getParameterSourcePosition(int paramNum)
BEGIN Custom change: precise bytecode positionsabstract AstMethod.LexicalParent[]
getParents()
MethodReference
getReference()
TypeReference
getReturnType()
Selector
getSelector()
something like: foo(Ljava/langString;)Ljava/lang/Class;String
getSignature()
something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;CAstSourcePositionMap.Position
getSourcePosition()
CAstSourcePositionMap.Position
getSourcePosition(int instructionIndex)
boolean
hasCatchBlock()
boolean
hasExceptionHandler()
boolean
hasMonitorOp()
boolean
isAbstract()
Is this method abstract?boolean
isBridge()
Is this method a bridge method? See JLS 3rd Edition 15.12.4.5boolean
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
isStatic()
Is this member static?boolean
isSynchronized()
Is this method synchronized?boolean
isSynthetic()
Did someone synthesize this method? (As opposed to reading it from a class file)AstMethod.LexicalInformation
lexicalInfo()
SymbolTable
symbolTable()
-
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:IMember
Get the annotations on this member, if any- Specified by:
getAnnotations
in interfaceIMember
-
getParents
public abstract AstMethod.LexicalParent[] getParents()
-
getDeclaringClass
public IClass getDeclaringClass()
Description copied from interface:IMember
Return the object that represents the declaring class for this member.- Specified by:
getDeclaringClass
in interfaceIMember
- Returns:
- the object that represents the declaring class for this member.
-
getSignature
public String getSignature()
Description copied from interface:IMethod
something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;- Specified by:
getSignature
in interfaceIMethod
-
getSelector
public Selector getSelector()
Description copied from interface:IMethod
something like: foo(Ljava/langString;)Ljava/lang/Class;- Specified by:
getSelector
in interfaceIMethod
-
isClinit
public boolean isClinit()
Description copied from interface:IMethod
Is this method a class initializer?
-
isInit
public boolean isInit()
Description copied from interface:IMethod
Is this method an object initializer?
-
getName
public Atom getName()
-
getDescriptor
public Descriptor getDescriptor()
Description copied from interface:IMethod
something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;- Specified by:
getDescriptor
in interfaceIMethod
-
getReference
public MethodReference getReference()
- Specified by:
getReference
in interfaceIMethod
- Returns:
- canonical MethodReference corresponding to this method
-
getReturnType
public TypeReference getReturnType()
- Specified by:
getReturnType
in interfaceIMethod
- Returns:
- the name of the return type for this method
-
isStatic
public boolean isStatic()
Description copied from interface:IMember
Is this member static?
-
isSynchronized
public boolean isSynchronized()
Description copied from interface:IMethod
Is this method synchronized?- Specified by:
isSynchronized
in interfaceIMethod
-
isNative
public boolean isNative()
Description copied from interface:IMethod
Is this method native?
-
isSynthetic
public boolean isSynthetic()
Description copied from interface:IMethod
Did someone synthesize this method? (As opposed to reading it from a class file)- Specified by:
isSynthetic
in interfaceIMethod
-
isAbstract
public boolean isAbstract()
Description copied from interface:IMethod
Is this method abstract?- Specified by:
isAbstract
in interfaceIMethod
-
isPrivate
public boolean isPrivate()
Description copied from interface:IMethod
Is this method private?
-
isProtected
public boolean isProtected()
Description copied from interface:IMethod
Is this method protected?- Specified by:
isProtected
in interfaceIMethod
-
isPublic
public boolean isPublic()
Description copied from interface:IMethod
Is this method public?
-
isFinal
public boolean isFinal()
Description copied from interface:IMethod
Is this method final?
-
isBridge
public boolean isBridge()
Description copied from interface:IMethod
Is this method a bridge method? See JLS 3rd Edition 15.12.4.5
-
getControlFlowGraph
public ControlFlowGraph getControlFlowGraph()
-
hasExceptionHandler
public boolean hasExceptionHandler()
- Specified by:
hasExceptionHandler
in interfaceIMethod
- Returns:
- true iff this method has at least one exception handler
-
hasMonitorOp
public boolean hasMonitorOp()
-
getNumberOfParameters
public int getNumberOfParameters()
Description copied from interface:IMethod
Method getNumberOfParameters. This result includes the "this" pointer if applicable- Specified by:
getNumberOfParameters
in interfaceIMethod
-
getParameterSourcePosition
public IMethod.SourcePosition getParameterSourcePosition(int paramNum) throws InvalidClassFileException
BEGIN Custom change: precise bytecode positions- Specified by:
getParameterSourcePosition
in interfaceIMethod
- Throws:
InvalidClassFileException
-
getLineNumber
public int getLineNumber(int instructionIndex)
END Custom change: precise bytecode positions- Specified by:
getLineNumber
in 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:
getSourcePosition
in interfaceIMethod
-
-