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 classMethodReference.KeyAn identifier/selector for methods.
-
Field Summary
Fields Modifier and Type Field Description static AtomclinitNamestatic SelectorclinitSelectorstatic DescriptordefaultInitDescstatic AtomequalsAtomstatic DescriptorequalsDescstatic SelectorequalsSelectorstatic AtomfinalizeNamestatic SelectorfinalizeSelectorstatic AtomforNameAtomstatic AtominitAtomstatic SelectorinitSelectorstatic MethodReferenceJavaLangClassForNamestatic MethodReferenceJavaLangClassNewInstancestatic MemberReferenceJavaLangReflectCtorNewInstancestatic MethodReferencelambdaMetafactorystatic AtomnewInstanceAtomstatic AtomrunAtomstatic DescriptorrunDescstatic SelectorrunSelector
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MethodReferencefindOrCreate(Language l, ClassLoaderReference loader, String methodClass, String methodName, String methodSignature)static MethodReferencefindOrCreate(Language l, TypeReference t, String methodName, String descriptor)static MethodReferencefindOrCreate(ClassLoaderReference loader, String methodClass, String methodName, String methodSignature)static MethodReferencefindOrCreate(TypeReference tref, Selector selector)Find or create the canonical MethodReference instance for the given tuple.static MethodReferencefindOrCreate(TypeReference tref, Atom mn, Descriptor md)Find or create the canonical MethodReference instance for the given tuple.static MethodReferencefindOrCreate(TypeReference t, String methodName, String descriptor)DescriptorgetDescriptor()intgetNumberOfParameters()This method does NOT include the implicit "this" parameterTypeReferencegetParameterType(int i)TypeReferencegetReturnType()SelectorgetSelector()StringgetSignature()booleanisInit()StringtoString()-
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:
getSignaturein 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
-
-