com.ibm.wala.types
Class MethodReference

java.lang.Object
  extended by com.ibm.wala.types.MemberReference
      extended by com.ibm.wala.types.MethodReference

public final class MethodReference
extends MemberReference

A class to represent the reference in a class file to a method.


Nested Class Summary
protected static class MethodReference.Key
          An identifier/selector for methods.
 
Field Summary
static Atom clinitName
           
static Selector clinitSelector
           
static Descriptor defaultInitDesc
           
static Atom equalsAtom
           
static Descriptor equalsDesc
           
static Selector equalsSelector
           
static Atom forNameAtom
           
static Atom initAtom
           
static Selector initSelector
           
static MethodReference JavaLangClassForName
           
static MethodReference JavaLangClassNewInstance
           
static MemberReference JavaLangReflectCtorNewInstance
           
static Atom newInstanceAtom
           
static Atom runAtom
           
static Descriptor runDesc
           
static Selector runSelector
           
 
Method Summary
static MethodReference findOrCreate(ClassLoaderReference loader, java.lang.String methodClass, java.lang.String methodName, java.lang.String methodSignature)
           
static MethodReference findOrCreate(TypeReference tref, Atom mn, Descriptor md)
          Find or create the canonical MethodReference instance for the given tuple.
static MethodReference findOrCreate(TypeReference tref, Selector selector)
          Find or create the canonical MethodReference instance for the given tuple.
static MethodReference findOrCreate(TypeReference t, java.lang.String methodName, java.lang.String descriptor)
           
 Descriptor getDescriptor()
           
 int getNumberOfParameters()
          Method getNumberOfParameters.
 TypeReference getParameterType(int i)
           
 TypeReference getReturnType()
           
 Selector getSelector()
          Method getSelector.
 java.lang.String getSignature()
          Method getSignature.
 boolean isInit()
           
 java.lang.String toString()
           
 
Methods inherited from class com.ibm.wala.types.MemberReference
equals, getDeclaringClass, getName, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

newInstanceAtom

public static final Atom newInstanceAtom

JavaLangClassNewInstance

public static final MethodReference JavaLangClassNewInstance

JavaLangReflectCtorNewInstance

public static final MemberReference JavaLangReflectCtorNewInstance

forNameAtom

public static final Atom forNameAtom

JavaLangClassForName

public static final MethodReference JavaLangClassForName

initAtom

public static final Atom initAtom

defaultInitDesc

public static final Descriptor defaultInitDesc

initSelector

public static final Selector initSelector

clinitName

public static final Atom clinitName

clinitSelector

public static final Selector clinitSelector

runAtom

public static final Atom runAtom

runDesc

public static final Descriptor runDesc

runSelector

public static final Selector runSelector

equalsAtom

public static final Atom equalsAtom

equalsDesc

public static final Descriptor equalsDesc

equalsSelector

public static final Selector equalsSelector
Method Detail

findOrCreate

public static MethodReference findOrCreate(TypeReference tref,
                                           Atom mn,
                                           Descriptor md)
Find or create the canonical MethodReference instance for the given tuple.

Parameters:
mn - the name of the member
md - the descriptor of the member

findOrCreate

public static MethodReference findOrCreate(TypeReference tref,
                                           Selector selector)
Find or create the canonical MethodReference instance for the given tuple.

Parameters:
tref - the type reference
selector - the selector for the method
Throws:
java.lang.IllegalArgumentException - if selector is null

findOrCreate

public static MethodReference findOrCreate(TypeReference t,
                                           java.lang.String methodName,
                                           java.lang.String descriptor)
                                    throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

findOrCreate

public static MethodReference findOrCreate(ClassLoaderReference loader,
                                           java.lang.String methodClass,
                                           java.lang.String methodName,
                                           java.lang.String methodSignature)
                                    throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getDescriptor

public final Descriptor getDescriptor()
Returns:
the descriptor component of this member reference

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

getReturnType

public final TypeReference getReturnType()
Returns:
return type of the method

getParameterType

public final TypeReference getParameterType(int i)
                                     throws java.lang.IllegalArgumentException
Returns:
ith parameter to the method. This does NOT include the implicit "this" pointer.
Throws:
java.lang.IllegalArgumentException

isInit

public boolean isInit()

getSignature

public java.lang.String getSignature()
Method getSignature. something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;

Specified by:
getSignature in class MemberReference
Returns:
String

getSelector

public Selector getSelector()
Method getSelector. something like: createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;

Returns:
Atom

getNumberOfParameters

public int getNumberOfParameters()
Method getNumberOfParameters. This method does NOT include the implicit "this" parameter

Returns:
int