Class ReflectiveEvaluator
java.lang.Object
org.checkerframework.common.value.ReflectiveEvaluator
Evaluates expressions (such as method calls and field accesses) at compile time, to determine
 whether they have compile-time constant values.
- 
Constructor SummaryConstructorsConstructorDescriptionReflectiveEvaluator(BaseTypeChecker checker, ValueAnnotatedTypeFactory factory, boolean reportWarnings) Create a new ReflectiveEvaluator.
- 
Method SummaryModifier and TypeMethodDescriptionevaluateMethodCall(@Nullable List<List<?>> allArgValues, @Nullable List<?> receiverValues, MethodInvocationTree tree) Returns all possible values that the method may return, or null if the method could not be evaluated.evaluateStaticFieldAccess(@ClassGetName String classname, String fieldName, ExpressionTree tree) Return the value of a static field access.evaluteConstructorCall(List<List<?>> argValues, NewClassTree tree, TypeMirror typeToCreate) 
- 
Constructor Details- 
ReflectiveEvaluatorpublic ReflectiveEvaluator(BaseTypeChecker checker, ValueAnnotatedTypeFactory factory, boolean reportWarnings) Create a new ReflectiveEvaluator.- Parameters:
- checker- the BaseTypeChecker
- factory- the annotated type factory
- reportWarnings- if true, report warnings about problems with evaluation
 
 
- 
- 
Method Details- 
evaluateMethodCallpublic @Nullable List<?> evaluateMethodCall(@Nullable List<List<?>> allArgValues, @Nullable List<?> receiverValues, MethodInvocationTree tree) Returns all possible values that the method may return, or null if the method could not be evaluated.- Parameters:
- 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 errors
- Returns:
- all possible values that the method may return, or null if the method could not be evaluated
 
- 
evaluateStaticFieldAccesspublic @Nullable Object evaluateStaticFieldAccess(@ClassGetName String classname, String fieldName, ExpressionTree tree) Return the value of a static field access. Return null if accessing the field reflectively fails.- Parameters:
- classname- the class containing the field
- fieldName- the name of the field
- tree- the static field access in the program. It is a MemberSelectTree or an IdentifierTree and is used for diagnostics.
- Returns:
- the value of the static field access, or null if it cannot be determined
 
- 
evaluteConstructorCallpublic @Nullable List<?> evaluteConstructorCall(List<List<?>> argValues, NewClassTree tree, TypeMirror typeToCreate) 
 
-