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
           
 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
 TypeReference[][] catchTypes
           
 AbstractCFG cfg
           
 IClass cls
           
 AstMethod.DebuggingInformation debugInfo
           
 boolean hasCatchBlock
           
 AstMethod.LexicalInformation lexicalInfo
           
 java.util.Collection qualifiers
           
 MethodReference ref
           
 SymbolTable symtab
           
 
Constructor Summary
protected AstMethod(IClass cls, java.util.Collection qualifiers, AbstractCFG cfg, SymbolTable symtab, MethodReference ref, boolean hasCatchBlock, TypeReference[][] catchTypes, AstMethod.LexicalInformation lexicalInfo, AstMethod.DebuggingInformation debugInfo)
           
protected AstMethod(IClass cls, java.util.Collection qualifiers, MethodReference ref)
           
 
Method Summary
 ControlFlowGraph getControlFlowGraph()
           
 IClass getDeclaringClass()
          Return the object that represents the declaring class for this member.
 Descriptor getDescriptor()
          Method getDescriptor.
 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 hasExceptionHandler()
           
 boolean isAbstract()
          Is this method abstract?
 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)
 boolean isVolatile()
          Is this member volatile?
 
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

public final IClass cls

qualifiers

public final java.util.Collection qualifiers

cfg

public final AbstractCFG cfg

symtab

public final SymbolTable symtab

ref

public final MethodReference ref

hasCatchBlock

public final boolean hasCatchBlock

catchTypes

public final TypeReference[][] catchTypes

lexicalInfo

public final AstMethod.LexicalInformation lexicalInfo

debugInfo

public final AstMethod.DebuggingInformation debugInfo
Constructor Detail

AstMethod

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

AstMethod

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

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
Returns:
String

getSelector

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

Specified by:
getSelector in interface IMethod
Returns:
String

isClinit

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

Specified by:
isClinit in interface IMethod
Returns:
boolean

isInit

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

Specified by:
isInit in interface IMethod
Returns:
boolean

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
Method getDescriptor. something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;

Specified by:
getDescriptor in interface IMethod
Returns:
Descriptor

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
Returns:
boolean

isNative

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

Specified by:
isNative in interface IMethod
Returns:
boolean

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
Returns:
boolean

isAbstract

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

Specified by:
isAbstract in interface IMethod
Returns:
boolean

isPrivate

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

Specified by:
isPrivate in interface IMethod
Returns:
boolean

isProtected

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

Specified by:
isProtected in interface IMethod
Returns:
boolean

isPublic

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

Specified by:
isPublic in interface IMethod
Returns:
boolean

isFinal

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

Specified by:
isFinal in interface IMethod
Returns:
boolean

isVolatile

public boolean isVolatile()
Description copied from interface: IMember
Is this member volatile?

Specified by:
isVolatile in interface IMember

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

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)