Android Studio 中自定义Lint MethodInvocation的简单解析

一.假如我们对某些方法做规则限制或者查找方法。会回调如下方法:

1.node.toString() 返回方法的调用者,修饰符,包括参数:animatorSet.addListener(listener) ,如果参数是接口,会返回接口的实现。

2.node.astName() 返回方法的名称如:addListener。

3.node.astOperand() 返回方法的调用者:animatorSet

4.node.astArguments() 返回方法的参数

二.经过下图转换

Android Studio 中自定义Lint MethodInvocation的简单解析_第1张图片


1.method.toString() 返回方法的定义:public android.animation.ValueAnimator setDuration(long)

2.method.method.getContainingClass():返回:public android.animation.ValueAnimator

你可能感兴趣的:(Android Studio 中自定义Lint MethodInvocation的简单解析)