|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.tools.lint.detector.api.TypeEvaluator
public class TypeEvaluator
Evaluates the types of nodes. This goes deeper than
JavaContext.getType(Node) in that it analyzes the
flow and for example figures out that if you ask for the type of var
in this code snippet:
Object o = new StringBuilder();
Object var = o;
it will return "java.lang.StringBuilder".
NOTE: This type evaluator does not (yet) compute the correct types when involving implicit type conversions, so be careful if using this for primitives; e.g. for "int * long" it might return the type "int".
| Constructor Summary | |
|---|---|
TypeEvaluator(JavaContext context)
Creates a new constant evaluator |
|
| Method Summary | |
|---|---|
static JavaParser.TypeDescriptor |
evaluate(JavaContext context,
lombok.ast.Node node)
Evaluates the given node and returns the likely type of the instance. |
JavaParser.TypeDescriptor |
evaluate(lombok.ast.Node node)
Returns true if the node evaluates to an instance of type SecureRandom |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TypeEvaluator(@Nullable
JavaContext context)
context - the context to use to resolve field references, if any| Method Detail |
|---|
@Nullable
public JavaParser.TypeDescriptor evaluate(@NonNull
lombok.ast.Node node)
@Nullable
public static JavaParser.TypeDescriptor evaluate(@NonNull
JavaContext context,
@NonNull
lombok.ast.Node node)
context - the context to use to resolve field references, if anynode - the node to compute the type for
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||