Package com.ibm.wala.analysis.reflection
Class GetMethodContext
- java.lang.Object
-
- com.ibm.wala.analysis.reflection.GetMethodContext
-
- All Implemented Interfaces:
Context
public class GetMethodContext extends Object implements Context
A context which may be used if- the method to be interpreted is either
Class.getMethod(String, Class...)
orClass.getDeclaredMethod(String, Class...)
, - the type of the "this" argument is known and
- the value of the first argument (the method name) is a constant.
GetMethodContextInterpreter
andGetMethodContextSelector
should be preferred overJavaLangClassContextInterpreter
andJavaLangClassContextSelector
, asGetMethodContextInterpreter
andGetMethodContextSelector
drastically reduce the number of methods returned increasing the precision of the analysis. Thus,GetMethodContextInterpreter
andGetMethodContextSelector
should be placed in be placed in front ofJavaLangClassContextInterpreter
andJavaLangClassContextSelector
.
-
-
Constructor Summary
Constructors Constructor Description GetMethodContext(TypeAbstraction type, ConstantKey name)
Construct this GetMethodContext.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
ContextItem
get(ContextKey name)
String
getName()
Get the name.TypeAbstraction
getType()
Get the type.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
GetMethodContext
public GetMethodContext(TypeAbstraction type, ConstantKey name)
Construct this GetMethodContext.- Parameters:
type
- the typename
- the name of the method
-
-
Method Detail
-
get
public ContextItem get(ContextKey name)
-
getType
public TypeAbstraction getType()
Get the type.- Returns:
- the type
-
getName
public String getName()
Get the name.- Returns:
- the name
-
-