Package com.ibm.wala.types
Class MethodReference
- java.lang.Object
-
- com.ibm.wala.types.MemberReference
-
- 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
Nested Classes Modifier and Type Class Description protected static class
MethodReference.Key
An identifier/selector for methods.
-
Field Summary
Fields Modifier and Type Field Description static Atom
clinitName
static Selector
clinitSelector
static Descriptor
defaultInitDesc
static Atom
equalsAtom
static Descriptor
equalsDesc
static Selector
equalsSelector
static Atom
finalizeName
static Selector
finalizeSelector
static Atom
forNameAtom
static Atom
initAtom
static Selector
initSelector
static MethodReference
JavaLangClassForName
static MethodReference
JavaLangClassNewInstance
static MemberReference
JavaLangReflectCtorNewInstance
static MethodReference
lambdaMetafactory
static Atom
newInstanceAtom
static Atom
runAtom
static Descriptor
runDesc
static Selector
runSelector
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MethodReference
findOrCreate(Language l, ClassLoaderReference loader, String methodClass, String methodName, String methodSignature)
static MethodReference
findOrCreate(Language l, TypeReference t, String methodName, String descriptor)
static MethodReference
findOrCreate(ClassLoaderReference loader, String methodClass, String methodName, String methodSignature)
static MethodReference
findOrCreate(TypeReference tref, Selector selector)
Find or create the canonical MethodReference instance for the given tuple.static MethodReference
findOrCreate(TypeReference tref, Atom mn, Descriptor md)
Find or create the canonical MethodReference instance for the given tuple.static MethodReference
findOrCreate(TypeReference t, String methodName, String descriptor)
Descriptor
getDescriptor()
int
getNumberOfParameters()
This method does NOT include the implicit "this" parameterTypeReference
getParameterType(int i)
TypeReference
getReturnType()
Selector
getSelector()
String
getSignature()
boolean
isInit()
String
toString()
-
Methods inherited from class com.ibm.wala.types.MemberReference
equals, getDeclaringClass, getName, hashCode
-
-
-
-
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
-
finalizeName
public static final Atom finalizeName
-
finalizeSelector
public static final Selector finalizeSelector
-
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
-
lambdaMetafactory
public static final MethodReference lambdaMetafactory
-
-
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 membermd
- 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 referenceselector
- the selector for the method- Throws:
IllegalArgumentException
- if selector is null
-
findOrCreate
public static MethodReference findOrCreate(TypeReference t, String methodName, String descriptor) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
findOrCreate
public static MethodReference findOrCreate(Language l, TypeReference t, String methodName, String descriptor) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
findOrCreate
public static MethodReference findOrCreate(ClassLoaderReference loader, String methodClass, String methodName, String methodSignature) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
findOrCreate
public static MethodReference findOrCreate(Language l, ClassLoaderReference loader, String methodClass, String methodName, String methodSignature) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getDescriptor
public final Descriptor getDescriptor()
- Returns:
- the descriptor component of this member reference
-
getReturnType
public final TypeReference getReturnType()
- Returns:
- return type of the method
-
getParameterType
public final TypeReference getParameterType(int i) throws IllegalArgumentException
- Returns:
- ith parameter to the method. This does NOT include the implicit "this" pointer.
- Throws:
IllegalArgumentException
-
isInit
public boolean isInit()
-
getSignature
public String getSignature()
- Specified by:
getSignature
in classMemberReference
- Returns:
- something like: com.foo.bar.createLargeOrder(IILjava/lang/String;Ljava/sql/Date;)Ljava/lang/Integer;
-
getSelector
public Selector getSelector()
- Returns:
- something like: createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;
-
getNumberOfParameters
public int getNumberOfParameters()
This method does NOT include the implicit "this" parameter
-
-