|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.tools.lint.detector.api.ConstantEvaluator
public class ConstantEvaluator
Evaluates constant expressions
| Constructor Summary | |
|---|---|
ConstantEvaluator(JavaContext context)
Creates a new constant evaluator |
|
| Method Summary | |
|---|---|
ConstantEvaluator |
allowUnknowns()
Whether we allow computing values where some terms are unknown. |
static java.lang.Object |
evaluate(JavaContext context,
lombok.ast.Node node)
Evaluates the given node and returns the constant value it resolves to, if any. |
java.lang.Object |
evaluate(lombok.ast.Node node)
Evaluates the given node and returns the constant value it resolves to, if any |
static java.lang.String |
evaluateString(JavaContext context,
lombok.ast.Node node,
boolean allowUnknown)
Evaluates the given node and returns the constant string it resolves to, if any. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConstantEvaluator(@Nullable
JavaContext context)
context - the context to use to resolve field references, if any| Method Detail |
|---|
public ConstantEvaluator allowUnknowns()
"foo" + x + "bar" would return null without and "foobar" with.
@Nullable
public java.lang.Object evaluate(@NonNull
lombok.ast.Node node)
node - the node to compute the constant value for
@Nullable
public static java.lang.Object 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 constant value for
@Nullable
public static java.lang.String evaluateString(@NonNull
JavaContext context,
@NonNull
lombok.ast.Node node,
boolean allowUnknown)
context - the context to use to resolve field references, if anynode - the node to compute the constant value forallowUnknown - whether we should construct the string even if some parts of it are
unknown
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||