Interface ResultUsePolicyAnalyzer<E,C>
- Type Parameters:
E
- the type of an expression node in the ASTC
- the type of the context object used during AST analysis
- All Known Implementing Classes:
AbstractReturnValueIgnored
,CheckReturnValue
,FutureReturnValueIgnored
,IgnoredPureGetter
,ProtoBuilderReturnValueIgnored
,RectIntersectReturnValueIgnored
,ReturnValueIgnored
,RxReturnValueIgnored
public interface ResultUsePolicyAnalyzer<E,C>
An object that can report on the behavior of a CRV-related check for analysis purposes.
-
Method Summary
Modifier and Type Method Description Set<String>
allNames()
Returns all of the name strings that this checker should respect as part of a@SuppressWarnings
annotation.String
canonicalName()
The canonical name of the check.default com.google.common.collect.ImmutableMap<String,? extends Object>
getMatchMetadata(E expression, C context)
Returns a map of optional metadata about why this check matched the given expression.ResultUsePolicy
getMethodPolicy(E expression, C context)
Returns theResultUsePolicy
for the method used in the givenexpression
.boolean
isCovered(E expression, C context)
Returns whether this checker makes any determination about whether the given expression's return value should be used or not.
-
Method Details
-
canonicalName
String canonicalName()The canonical name of the check. -
allNames
Returns all of the name strings that this checker should respect as part of a@SuppressWarnings
annotation. -
isCovered
Returns whether this checker makes any determination about whether the given expression's return value should be used or not. Most checkers either determine that an expression is CRV or make no determination. -
getMethodPolicy
Returns theResultUsePolicy
for the method used in the givenexpression
. -
getMatchMetadata
default com.google.common.collect.ImmutableMap<String,? extends Object> getMatchMetadata(E expression, C context)Returns a map of optional metadata about why this check matched the given expression.
-