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.
GetMethodContextInterpreterandGetMethodContextSelectorshould be preferred overJavaLangClassContextInterpreterandJavaLangClassContextSelector, asGetMethodContextInterpreterandGetMethodContextSelectordrastically reduce the number of methods returned increasing the precision of the analysis. Thus,GetMethodContextInterpreterandGetMethodContextSelectorshould be placed in be placed in front ofJavaLangClassContextInterpreterandJavaLangClassContextSelector.
-
-
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 booleanequals(Object obj)ContextItemget(ContextKey name)StringgetName()Get the name.TypeAbstractiongetType()Get the type.inthashCode()StringtoString()
-
-
-
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
-
-