com.ibm.wala.cast.loader
Class AstMethod

java.lang.Object
  extended by com.ibm.wala.cast.loader.AstMethod
All Implemented Interfaces:
IMember, IMethod, ContextItem, IClassHierarchyDweller
Direct Known Subclasses:
JavaScriptLoader.JavaScriptMethodObject, JavaSourceLoaderImpl.ConcreteJavaMethod

public abstract class AstMethod
extends java.lang.Object
implements IMethod


Nested Class Summary
static interface AstMethod.DebuggingInformation
           
static interface AstMethod.LexicalInformation
           
static class AstMethod.LexicalParent
          Parents of this method with respect to lexical scoping, that is, methods containing state possibly referenced lexically in this method
 
Field Summary
protected  IClass cls
           
 
Constructor Summary
protected AstMethod(IClass cls, java.util.Collection qualifiers, AbstractCFG cfg, SymbolTable symtab, MethodReference ref, boolean hasCatchBlock, TypeReference[][] catchTypes, boolean hasMonitorOp, AstTranslator.AstLexicalInformation lexicalInfo, AstMethod.DebuggingInformation debugInfo)
           
protected AstMethod(IClass cls, java.util.Collection qualifiers, MethodReference ref)
           
 
Method Summary
 TypeReference[][] catchTypes()
           
 AbstractCFG cfg()
           
 AstMethod.LexicalInformation cloneLexicalInfo()
           
 AstMethod.DebuggingInformation debugInfo()
           
 ControlFlowGraph 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)
           
 Atom getName()
           
 int getNumberOfParameters()
          Method getNumberOfParameters.
abstract  AstMethod.LexicalParent[] getParents()
           
 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;
 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.5
 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 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.classLoader.IMethod
getDeclaredExceptions, getLocalVariableName, getMaxLocals, getMaxStackHeight, getParameterType, hasLocalVariableTable
 
Methods inherited from interface com.ibm.wala.ipa.cha.IClassHierarchyDweller
getClassHierarchy
 

Field Detail

cls

protected final IClass cls
Constructor Detail

AstMethod

protected AstMethod(IClass cls,
                    java.util.Collection qualifiers,
                    AbstractCFG cfg,
                    SymbolTable symtab,
                    MethodReference ref,
                    boolean hasCatchBlock,
                    TypeReference[][] catchTypes,
                    boolean hasMonitorOp,
                    AstTranslator.AstLexicalInformation lexicalInfo,
                    AstMethod.DebuggingInformation debugInfo)

AstMethod

protected AstMethod(IClass cls,
                    java.util.Collection qualifiers,
                    MethodReference ref)
Method Detail

cfg

public AbstractCFG cfg()

hasCatchBlock

public boolean hasCatchBlock()

symbolTable

public SymbolTable symbolTable()

catchTypes

public TypeReference[][] catchTypes()

cloneLexicalInfo

public AstMethod.LexicalInformation cloneLexicalInfo()

lexicalInfo

public AstMethod.LexicalInformation lexicalInfo()

debugInfo

public AstMethod.DebuggingInformation debugInfo()

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 interface IMember
Returns:
the object that represents the declaring class for this member.

getSignature

public java.lang.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 interface IMethod

getSelector

public Selector getSelector()
Description copied from interface: IMethod
something like: foo(Ljava/langString;)Ljava/lang/Class;

Specified by:
getSelector in interface IMethod

isClinit

public boolean isClinit()
Description copied from interface: IMethod
Is this method a class initializer?

Specified by:
isClinit in interface IMethod

isInit

public boolean isInit()
Description copied from interface: IMethod
Is this method an object initializer?

Specified by:
isInit in interface IMethod

getName

public Atom getName()
Specified by:
getName in interface IMember
Returns:
the name of this member

getDescriptor

public Descriptor getDescriptor()
Description copied from interface: IMethod
something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;

Specified by:
getDescriptor in interface IMethod

getReference

public MethodReference getReference()
Specified by:
getReference in interface IMethod
Returns:
canonical MethodReference corresponding to this method

getReturnType

public TypeReference getReturnType()
Specified by:
getReturnType in interface IMethod
Returns:
the name of the return type for this method

isStatic

public boolean isStatic()
Description copied from interface: IMember
Is this member static?

Specified by:
isStatic in interface IMember

isSynchronized

public boolean isSynchronized()
Description copied from interface: IMethod
Is this method synchronized?

Specified by:
isSynchronized in interface IMethod

isNative

public boolean isNative()
Description copied from interface: IMethod
Is this method native?

Specified by:
isNative in interface IMethod

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 interface IMethod

isAbstract

public boolean isAbstract()
Description copied from interface: IMethod
Is this method abstract?

Specified by:
isAbstract in interface IMethod

isPrivate

public boolean isPrivate()
Description copied from interface: IMethod
Is this method private?

Specified by:
isPrivate in interface IMethod

isProtected

public boolean isProtected()
Description copied from interface: IMethod
Is this method protected?

Specified by:
isProtected in interface IMethod

isPublic

public boolean isPublic()
Description copied from interface: IMethod
Is this method public?

Specified by:
isPublic in interface IMethod

isFinal

public boolean isFinal()
Description copied from interface: IMethod
Is this method final?

Specified by:
isFinal in interface IMethod

isBridge

public boolean isBridge()
Description copied from interface: IMethod
Is this method a bridge method? See JLS 3rd Edition 15.12.4.5

Specified by:
isBridge in interface IMethod

getControlFlowGraph

public ControlFlowGraph getControlFlowGraph()

hasExceptionHandler

public boolean hasExceptionHandler()
Specified by:
hasExceptionHandler in interface IMethod
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 interface IMethod

getLineNumber

public int getLineNumber(int instructionIndex)
Specified by:
getLineNumber in interface IMethod
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)