public class ReflectiveEvaluator extends Object
Constructor and Description |
---|
ReflectiveEvaluator(BaseTypeChecker checker,
ValueAnnotatedTypeFactory factory,
boolean reportWarnings)
Create a new ReflectiveEvaluator.
|
Modifier and Type | Method and Description |
---|---|
List<?> |
evaluateMethodCall(List<List<?>> allArgValues,
List<?> receiverValues,
MethodInvocationTree tree)
Returns all possible values that the method may return, or null if the method could not be
evaluated.
|
Object |
evaluateStaticFieldAccess(@ClassGetName String classname,
String fieldName,
ExpressionTree tree)
Return the value of a static field access.
|
List<?> |
evaluteConstructorCall(ArrayList<List<?>> argValues,
NewClassTree tree,
TypeMirror typeToCreate) |
public ReflectiveEvaluator(BaseTypeChecker checker, ValueAnnotatedTypeFactory factory, boolean reportWarnings)
checker
- the BaseTypeCheckerfactory
- the annotated type factory.reportWarnings
- if true, report warnings about problems with evaluationpublic List<?> evaluateMethodCall(List<List<?>> allArgValues, List<?> receiverValues, MethodInvocationTree tree)
allArgValues
- a list of lists where the first list corresponds to all possible values for
the first argument. Pass null to indicate that the method has no arguments.receiverValues
- a list of possible receiver values. null indicates that the method has no
receiver.tree
- location to report any errorspublic Object evaluateStaticFieldAccess(@ClassGetName String classname, String fieldName, ExpressionTree tree)
classname
- the class containing the fieldfieldName
- the name of the fieldtree
- the static field access in the program. It is a MemberSelectTree or an
IdentifierTree and is used for diagnostics.public List<?> evaluteConstructorCall(ArrayList<List<?>> argValues, NewClassTree tree, TypeMirror typeToCreate)