CodeNavi自定义规则节点属性(基础节点)
节点 |
描述 |
示例 |
属性 |
||||
名称 |
描述 |
值类型 |
示例 |
DSL 规则 |
|||
annotation |
注解 |
public class Test extends ArrayList { |
name |
名称 |
字符串 |
@TheAnnotation(isOk = false) |
annotation ann where ann.name == "TheAnnotation"; |
annoMembers |
注解的注解项 |
annomember节点集合 |
@TheAnnotation(isOk = false, num = 3, str = Test.test1) |
annotation ann where |
|||
annoMember |
注解项 |
@TheAnnotation(isOk = false, num = 3, str = Test.test1) |
name |
名称 |
字符串 |
@TheAnnotation(isOk = false, num = 3, str = Test.test1) |
annotation ann where |
annoValue |
注解项的具体值 |
literal、enumConstantAccess、fieldAcccess节点 |
@TheAnnotation(isOk = false, num = 3, str = Test.test1) |
annotation ann where |
|||
recordDeclaration |
类/接口声明 |
public class MyClass { } |
name |
类名,包含包名 |
字符串 |
package com.huawei.secbrella.kirin.test.sourcefile.record; |
recordDeclaration rd where |
comments |
注释 |
comment节点集合 |
// 注释 |
recordDeclaration rd where |
|||
kind |
类类型,可能是interface或class |
字符串 |
public class TypeTest { |
recordDeclaration rd where |
|||
superTypes |
所有直接和间接集成的父类和接口 |
recordDeclartion节点集合 |
class MyList extends ArrayList<String> { |
recordDeclaration rd where |
|||
directSuperTypes |
直接集成的父类和接口 |
recordDeclartion节点集合 |
class MyList extends ArrayList<String> { |
recordDeclaration rd where |
|||
definedFields |
类中定义的所有字段 |
fieldDeclaration节点集合 |
class RecordDeclarationDemo extends Father { // 告警行 |
recordDeclaration rd where |
|||
definedConstructors |
类中定义的所有构造方法 |
functionCall节点集合 |
class RecordDeclarationDemo extends Father { // 告警行 |
recordDeclaration rd where |
|||
definedMethods |
类中定义的所有方法 |
functionCall节点集合 |
class RecordDeclarationDemo extends Father { // 告警行 |
recordDeclaration rd where |
|||
anonymousInnerClassExpression |
匿名内部类表达式 |
public static void main(String[] args) { |
name |
|
字符串 |
public static void main(String[] args) { |
anonymousInnerClassExpression ac where and( |
anonymousClassBody |
|
任意节点集合 |
public static void main(String[] args) { |
anonymousInnerClassExpression ac where |
|||
arrayAccess |
数组访问表达式 |
int a = arr[3]; |
arrayIndex |
|
literal、任意access类节点、functionCall节点等 |
Integer[] arr = {0,1,2,3,4}; |
arrayAccess aa where and( |
base |
|
variableAccess等任意access类节点、functionCall节点等 |
int a = arr[3]; |
arrayAccess arr where or( |
|||
rootBase |
|
variableAccess等任意access类节点、functionCall节点等 |
String[] a1 = arr[3]; |
arrayAccess arr where arr.rootBase rb where and( |
|||
type |
|
objectType节点 |
System.out.println(hello[1]); |
arrayAccess arr where |
|||
arrayCreationExpression |
数组创建表达式 |
int[] arr = new String[11]; |
dimensions |
数组的维度集合 |
节点集合 |
String[] array = new String[10]; |
arrayCreationExpression ac where |
dimensions[] |
数组的维度 |
numLiteral、access类节点、functionCall节点等 |
String[] array = new String[10][a]; |
arrayCreationExpression ac where and( |
|||
initArray |
数组创建的初始化值 |
initArrayExpression |
String[] array2 = new String[]{"abc", "dec"}; |
arrayCreationExpression ac where |
|||
type |
数组创建的类型 |
objectType节点 |
String[] array = new String[10]; |
arrayCreationExpression ac where |
|||
initArrayExpression |
初始化数组表达式 |
int[] arr = {1, 2, 4}; |
elements |
数组初始化包含的元素集合 |
节点集合 |
names = {"ok", "hello", "yes"} |
initArrayExpression ia where |
elements[] |
数组初始化的元素 |
literal类节点、变量类 |
new String[] {"ok", "ey"}; |
initArrayExpression ia where |
|||
functionDeclaration |
方法声明 |
public void fun() { |
name |
方法名 |
字符串 |
public static void debugFirst() { |
functionDeclaration fd where |
isConstructor |
是否构造函数 |
布尔值 |
public MyTest() {} |
functionDeclaration fd where |
|||
hasBody |
是否有方法体 |
布尔值 |
public static void debugFirst() { |
functionDeclaration fd where |
|||
comments |
方法的注释 |
comments节点 |
// 注释 |
functionDeclaration fd where |
|||
type |
返回值的类型 |
objectType节点 |
public static String sayHello() { |
functionDeclaration fd where |
|||
functionUsages |
调用了该方法的位置 |
functionCall节点集合 |
public static void debugFirst() { |
functionDeclaration fd where and( |
|||
callers |
调用了该方法的位置所在方法声明 |
functionDeclaration节点集合 |
public static void debugFirst() { |
functionDeclaration fd where and( |
|||
assignStatements |
方法体中的所有assignStatement节点 |
assignStatement节点集合 |
public void functionCalls_first_argument() { String s = "hello"; StringBuilder sb = new StringBuilder(""); } |
functionDeclaration fd where fd.assignStatements.size() == 2; |
|||
fieldAccesses |
方法体中的所有fieldAccesses节点 |
fieldAccesses节点集合 |
public void fieldAccesses_boolean() { |
functionDeclaration fd where |
|||
functionCalls |
方法体中的所有functionCall节点 |
functionCall节点集合 |
public void assignStatements_function_call_to_variable() { |
functionDeclaration fd where |
|||
ifBlocks |
方法体中的所有ifBlock节点 |
ifBlock节点集合 |
public void loopBlocks_for(boolean flag) { |
functionDeclaration fd where |
|||
loopBlocks |
方法体中的所有loopBlock节点 |
loopBlock节点集合 |
public void loopBlocks_while(boolean flag) { |
functionDeclaration fd where |
|||
parameters |
方法体中的所有parameterDeclaration节点 |
parameterDeclaration节点集合 |
public void loopBlocks_for(boolean flag) {} |
functionDeclaration fd where |
|||
returnStatements |
方法体中的所有returnStatement节点 |
returnStatement节点集合 |
public int returnStatements_return_int(int m) { |
functionDeclaration fd where |
|||
variableAccesses |
方法体中的所有variableAccess节点 |
variableAccess节点集合 |
public void loopBlocks_while(boolean flag) { |
functionDeclaration fd where |
|||
body |
方法体 |
body语句块 |
public void loopBlocks_while(boolean flag) { |
functionDeclaration fd where |
|||
body.statementNum |
方法体的语句数量 |
数值 |
public String functionCase() { |
functionDeclaration fd where |
|||
firstStatement |
方法的第一个完整的语句 |
任意节点 |
public String functionCase() { |
functionDeclaration fd where |
|||
lastStatement |
方法的最后一个完整的语句 |
任意节点 |
private boolean isNumeric(String str) { |
functionDeclaration fd where |
|||
subMethods |
所有重写了该方法的子类方法 |
functionDecalration节点集合 |
public class FatherDemo { |
functionDeclaration fd where |
|||
superMethods |
该方法重写的父类方法 |
functionDecalration节点集合 |
public class FatherDemo { |
functionDeclaration fd where |
|||
paramDeclaration |
参数声明,方法定义中的参数定义 |
public void fun(String name) { |
name |
参数的名字 |
字符串 |
public void fun(String name) { |
paramDeclaration pa where pa.name == "name"; |
type |
参数的类型 |
objectType节点 |
public void fun(String name) { |
paramDeclaration pa where pa.type.name == "java.lang.String"; |
|||
functionCall |
方法调用 |
Objects.isNull(str); |
name |
方法名 |
字符串 |
Objects.isNull(str); |
functionCall fc where |
function |
调用的方法 |
functionDeclaration节点 |
public String functionCase() { |
functionCall fc where fc.function fd where and( |
|||
possibleFunctions |
调用的方法及其重写与被重写的方法,用于多态类创建对象时,声明类型为父类,实例化类型为子类型,调用对象方法时function属性应定位到子类的方法中,但实际会定位到父类方法中,用此属性规避这种问题导致的漏报 |
functionDeclaration节点 |
public static void main(String[] args) { |
functionCall fc2 where and( |
|||
base |
直接调用者 |
valueAccess类节点、functionCall节点等 |
MyRandom.aa(); |
functionCall fc where and( |
|||
rootBase |
根调用者 |
valueAccess类节点、functionCall节点等 |
a().b().c(); |
functionCall fc where and( fc.name == "c", fc.rootBase is functionCall, fc.rootBase.name == "a"); |
|||
arguments |
入参集合 |
valueAccess类节点、functionCall节点等的集合 |
sb.append(s.toUpperCase(Locale.ENGLISH)); |
functionCall fc where fc.arguments contain arg where |
|||
arguments[n] |
第n个入参 |
valueAccess类节点、functionCall节点等的集合 |
add(a, b); |
functionCall fc where |
|||
argument |
函数入参 |
JSON.parseObject("{\"name\":\"A\"}", Demo.class); |
name |
参数名 |
字符串 |
System.out.println(i) |
argument arg where arg.name == "i"; |
argumentIndex |
参数的index |
数值 |
System.out.println(i) |
argument arg where arg.argumentIndex == 0; |
|||
argumentHolder |
使用该参数的方法调用 |
functionCall节点 |
System.out.println(i) |
argument arg where arg.argumentHolder.name == "println"; |
|||
methodReferenceExpression |
方法引用表达式 |
List::stream |
name |
方法名 |
字符串 |
Supplier<Integer> size = list::size; |
methodReferenceExpression mf where |
function |
调用的方法 |
functionDeclaration节点 |
Supplier<Integer> size = list::size; |
methodReferenceExpression mf where |
|||
type |
方法返回值类型 |
objectType节点 |
Supplier<Integer> size = list::size; |
methodReferenceExpression mf where |
|||
objectCreationExpression |
对象创建表达式 |
new ArrayList(); |
name |
方法名 |
字符串 |
new MethodRefTypeTest(); |
objectCreationExpression obc where |
type |
返回值类型 |
objectType节点 |
new MethodRefTypeTest(); |
objectCreationExpression obc where |
|||
function |
调用的构造方法 |
functionDeclaration节点 |
public class MethodRefTypeTest { |
objectCreationExpression obc where |
|||
arguments |
入参集合 |
valueAccess类节点、functionCall节点等的集合 |
new String("Hello"); |
objectCreationExpression obc where |
|||
arguments[n] |
第n个入参 |
valueAccess类节点、functionCall节点等的集合 |
new String("Hello"); |
objectCreationExpression obc where |
|||
assignStatement |
赋值语句,同时也是二元表达式 |
a = 10; |
lhs |
赋值语句的左值 |
valueAccess类节点 |
a = 10; |
assignStatement ass where ass.lhs.name == "a"; |
rhs |
赋值语句的右值 |
literal类节点、valueAccess类节点、functionCall类节点 |
a = 10; |
assignStatement ass where ass.rhs.value == 10; |
|||
binaryOperation |
二元表达式,包括 +、-、*、/运算、=赋值运算等 |
a = 10; |
lhs |
二元表达式的左值 |
literal类节点、valueAccess类节点、functionCall类节点 |
int i = 1; |
binaryOperation bo where bo.lhs.name == "i"; |
operator |
二元表达式的操作符 |
字符串 |
while (i == 1) |
binaryOperation bo where bo.operator == "=="; |
|||
rhs |
二元表达式的右值 |
literal类节点、valueAccess类节点、functionCall类节点 |
a > b; |
binaryOperation bo where bo.rhs.name == "b"; |
|||
operands |
二元表达的操作对象(左值和右值) |
节点集合 |
a > b; |
binaryOperation bo where |
|||
castExpression |
强制类型转换 |
Son sonFromDad = (Son) dad; |
castType |
目标类型 |
node |
ArrayList second = (ArrayList) list; |
castExpression ce where |
operand |
操作对象 |
node |
ArrayList second = (ArrayList) list; |
castExpression ce where |
|||
fieldDeclaration |
字段定义(声明) |
public static int count = 0; |
name |
字段名 |
字符串 |
private int aes_key = 3; |
fieldDeclaration fd where fd.name == "aes_key"; |
comments |
注释 |
comment节点集合 |
// 注释 |
fieldDeclaration fd where fd.comments contain lineComment; |
|||
initializer |
初始化值 |
任意节点 |
private int aes_key = 3; |
fieldDeclaration fd where fd.initializer.value == 3; |
|||
valueUsages |
使用该字段的节点 |
valueAccess类节点、functionCall节点等 |
private int aes_key = 3; |
fieldDeclaration fed where |
|||
fieldAccess |
字段(成员变量)访问 |
System.out.println(Person.name); |
name |
字段名 |
字符串 |
Person.name |
fieldAccess fa where fa.name == "name"; |
field |
字段定义 |
fieldDeclaration节点 |
private int aes_key = 3; |
fieldAccess fa where fa.field.initializer.value == 3; |
|||
base |
访问者 |
任意节点 |
Person.name |
fieldAccess fa where fa.base.name == "Person"; |
|||
enumDeclaration |
枚举类声明 |
enum MyEnum { |
name |
枚举全类名 |
字符串 |
enum TheEnum { |
enumDeclaration ed where ed.name == "com.huawei.secbrella.kirin.test.sourcefile.enumConstantTest.TheEnum"; |
definedFields |
定义的所有字段 |
fieldDeclaration节点集合 |
enum Planet { |
enumDeclaration ed where |
|||
definedMethods |
定义的所有方法 |
functionDeclaration节点集合 |
enum Planet { |
enumDeclaration ed where |
|||
enumConstants |
定义的所有枚举常量 |
enumConstant节点集合 |
enum Planet { |
enumDeclaration ed where ed.enumConstants.size() == 4; |
|||
enumConstantDeclaration |
枚举常量声明, 枚举类中用逗号分隔的常量 |
public enum DayOfWeek { |
name |
枚举常量名 |
字符串 |
public enum DayOfWeek { |
enumConstantDeclaration ed where ed.name == "Monday"; |
definedEnumConstantFields |
枚举常量中定义的所有字段 |
fieldDeclaration节点的集合 |
enum Week3 { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday { private String tmp = "test"; }} |
enumConstantDeclaration ed where ed.definedEnumConstantFields.size() == 1; |
|||
definedEnumConstantMethods |
枚举常量中定义的所有方法 |
functionDeclaration节点的集合 |
enum Week3 { |
enumConstantDeclaration ed where |
|||
enumConstantArguments |
枚举常量中的入参 |
literal节点、valueAccess类节点、functionCall节点等的集合 |
enum Planet { |
enumConstantDeclaration ed where |
|||
enumConstantAccess |
枚举常量访问 |
public void fun(DayOfWeek n) { |
name |
枚举常量名 |
字符串 |
Planet.EARTH; |
enumConstantAccess ea where ea.name == "EARTH"; |
enumConstant |
访问的枚举常量所在声明 |
enumConstant节点 |
Planet.EARTH; |
enumConstantAccess ea where ea.enumConstant.name == "EARTH"; |
|||
base |
访问者 |
任意节点 |
Planet.EARTH; |
enumConstantAccess ea where ea.base.name == "Planet"; |
|||
exceptionBlock |
异常捕捉代码块,包括tryBlock、catchBlock、finallyBlock |
try { |
tryBlock |
try语句块 |
tryBlock节点 |
try { |
exceptionBlock eb where |
catchBlocks |
所有的catch语句块 |
catchBlock节点的集合 |
try { |
exceptionBlock eb where |
|||
finallyBlock |
finally语句块 |
finallyBlock节点 |
try { |
exceptionBlock eb where |
|||
tryBlock |
try语句块 |
try { } |
_ |
try语句块 |
tryBlock节点 |
try { |
tryBlock tb where |
catchBlock |
catch语句块 |
try { |
parameters |
|
node list |
try { |
catchBlock cb where |
finallyBlock |
finally代码块 |
finally { |
_ |
finally语句块 |
finallyBlock节点 |
try { |
finallyBlock fb where |
tryWithResources |
tryWithResources异常捕捉代码块 |
try (Statement stmt = con.createStatement()) { |
tryBlock |
try语句块 |
tryBlock节点 |
try (Statement stmt = con.createStatement()) { |
tryWithResources eb where |
catchBlocks |
所有的catch语句块 |
catchBlock节点的集合 |
try (Statement stmt = con.createStatement()) { |
tryWithResources eb where |
|||
finallyBlock |
finally语句块 |
finallyBlock节点 |
try (Statement stmt = con.createStatement()) { |
tryWithResources eb where |
|||
resources |
任意节点 |
若干statements节点的集合 |
try (Statement stmt = con.createStatement()) { |
tryWithResources twr where |
|||
throwStatement |
throw语句,异常抛出语句 |
try { |
operand |
|
node |
throw new Exception(); |
throwStatement tr where |
forBlock |
for循环代码块 |
for (int i = 0; i < list.size(); i++) { |
initialization |
变量初始化 |
variableDeclaration、 variableAccess节点 |
for (int i = 0; i < list.size(); i++) { |
forBlock fb where fb.initialization.name == "i"; |
condition |
循环条件 |
binaryOperation |
for (int i = 0; i < list.size(); i++) { |
forBlock fb where fb.condition.rhs is functionCall; |
|||
iteration |
迭代操作 |
unaryOperation节点 |
for (int i = 0; i < list.size(); i++) { |
forBlock fb where fb.iteration.operator == "++"; |
|||
body |
循环体 |
body语句块 |
for (int i = 0; i < list.size(); i++) { |
forBlock fb where |
|||
body.statementNum |
body语句块的语句数量 |
数值 |
for (int i = 0; i < list.size(); i++) { |
forBlock fb where |
|||
firstStatement |
forBlock的第一条语句 |
任意节点 |
for (int i = 0; i < list.size(); i++) { |
forBlock fb where |
|||
lastStatement |
forBlock的最后一条语句 |
任意节点 |
for (int j1 = 1; j1 < 50 && k1 < 50; j1++, k1++) { |
forBlock fb where |
|||
forEachBlock |
forEach循环代码块 |
for (Integer integer : list) { |
variable |
循环变量 |
variableDeclaration节点 |
for (String str : list) { |
forEachBlock fb where and( |
iterable |
被循环的变量 |
任意节点 |
for (String str : list) { |
forEachBlock fb where |
|||
body |
循环体 |
body语句块 |
for (String str : list) { |
forEachBlock fb where |
|||
body.statementNum |
body语句块的语句数量 |
数值 |
for (String str : list) { |
forEachBlock fb where |
|||
firstStatement |
forEachBlock的第一条语句 |
任意节点 |
for (String str : list) { |
forEachBlock fb where |
|||
lastStatement |
forEachBlock的最后一条语句 |
任意节点 |
for (String str : list) { |
forEachBlock fb where |
|||
whileBlock |
while循环语句块 |
while() { |
condition |
循环条件 |
任意节点 |
while(i > list.size()) { |
whileBlock wb where |
body |
循环体 |
body语句块 |
while(i > list.size()) { i++;} |
whileBlock wb where wb.body contain unaryOperation; |
|||
body.statementNum |
body语句块的语句数量 |
数值 |
while(i > list.size()) { |
whileBlock wb where |
|||
firstStatement |
whileBlock的第一条语句 |
任意节点 |
while(i > list.size()) { |
whileBlock wb where |
|||
lastStatement |
whileBlock的最后一条语句 |
任意节点 |
while(i > list.size()) { |
whileBlock wb where |
|||
doWhileBlock |
do…while语句块 |
do { |
condition |
循环条件 |
任意节点 |
do { |
doWhileBlock wb where |
body |
循环体 |
body语句块 |
do { |
doWhileBlock wb where |
|||
body.statementNum |
body语句块的语句数量 |
数值 |
do { |
whileBlock wb where |
|||
firstStatement |
forBlock的第一条语句 |
任意节点 |
do { |
doWhileBlock wb where |
|||
lastStatement |
forBlock的最后一条语句 |
任意节点 |
do { |
doWhileBlock wb where |
|||
loopBlock |
循环语句块,包括forBlock, forEachBlock, doWhileBlock, whileBlock |
for() {}; |
condition |
循环条件 |
任意节点 |
while(i > list.size()) { |
whileBlock wb where |
body |
循环体 |
body语句块 |
while(i > list.size()) { |
whileBlock wb where |
|||
body.statementNum |
body语句块的语句数量 |
数值 |
while(i > list.size()) { |
whileBlock wb where |
|||
firstStatement |
loopBlock的第一条语句 |
任意节点 |
while(i > list.size()) { |
whileBlock wb where |
|||
lastStatement |
loopBlock的最后一条语句 |
任意节点 |
while(i > list.size()) { |
whileBlock wb where |
|||
ifBlock |
if语句块 |
if(num > 10) { |
condition |
if条件 |
binaryOperation节点 |
if (m > 10) { |
ifBlock ib where |
thenBlock |
if条件为true执行的语句 |
block语句块 |
if (m > 10) { |
ifBlock ib where |
|||
elseBlock |
if条件为false执行的语句 |
block语句块 |
if (m > 10) { |
ifBlock ib where |
|||
thenBlock |
then语句块,if 条件成立后执行 |
if(num > 10) { |
_ |
if条件为true执行的语句 |
block语句块 |
if (m > 10) { |
thenBlock tb where |
elseBlock |
else语句块 |
else { |
_ |
if条件为false执行的语句 |
block语句块 |
if (m > 10) { |
elseBlock eb where |
importDeclaration |
import声明 |
import com.huawei.java…. |
name |
import的类名 |
字符串 |
import static java.lang.String.valueOf; |
importDeclaration im where |
isStatic |
import是否为静态 |
布尔值 |
import static java.lang.String.valueOf; |
importDeclaration im where |
|||
instanceofExpression |
类型判断表达式 |
if(father instanceof Father) { |
lhs |
左值 |
任意节点 |
father instanceof Father |
instanceofExpression ie where |
rhs |
右值,类型值 |
全类名常量 |
list instanceof List |
instanceofExpression ie where |
|||
lambdaExpression |
lambda表达式 |
list.forEach(integer -> { |
parameters |
参数 |
paramDeclaration节点 |
list.forEach(integer -> { |
lambdaExpression le where |
body |
方法体 |
block语句块 |
list.forEach(integer -> { |
lambdaExpression le where |
|||
body.statementNum |
body语句块的语句数量 |
数值 |
list.forEach(integer -> { |
lambdaExpression le where |
|||
firstStatement |
lambdaExpression的第一条语句 |
任意节点 |
list.forEach(integer -> { |
lambdaExpression le where |
|||
lastStatement |
lambdaExpression的最后一条语句 |
任意节点 |
list.forEach(integer -> { |
lambdaExpression le where |
|||
literal |
常量,包括字符串、布尔、数字常量 |
Constant appeared in source code |
value |
常量值 |
字符串、数值、布尔值等 |
int a = 1; |
literal ll where ll.value == 1; |
stringLiteral |
字符串常量 |
System.out.println("aaa"); |
length |
字符串长度 |
数值 |
System.out.println("aaa"); |
stringLiteral l where l.length == 3; |
value |
字符串值 |
字符串 |
System.out.println("aaa"); |
stringLiteral l where l.value == "aaa"; |
|||
boolLiteral |
布尔常量 |
System.out.println(true); |
value |
布尔值 |
布尔值 |
System.out.println(true); |
boolLiteral l where l.value == true; |
numLiteral |
数字常量 |
System.out.println(1); |
value |
数值 |
数值 |
System.out.println(1); |
numLiteral l where l.value == 1; |
returnStatement |
return语句 |
return a; |
returnValue |
返回值 |
任意节点 |
return a; |
returnStatement rs where rs.returnValue.name == "a"; |
breakStatement |
break语句 |
break; |
_ |
_ |
_ |
break; |
breakStatement; |
continueStatement |
continue语句 |
continue; |
_ |
_ |
_ |
continue; |
continueStatement; |
staticBlock |
静态语句块 |
class A { |
_ |
_ |
block语句块 |
static { |
staticBlock sb where sb contain variableDeclaration; |
switchBlock |
Switch语句块 |
switch (n) { |
selector |
switch语句的判断条件 |
任意节点 |
switch (m) { |
switchBlock swb where |
caseStatement |
case语句块 |
switch (m) { |
_ |
_ |
caseStatement节点 |
switch (m) { |
caseStatement cs where cs contain literal; |
defaultStatement |
default语句块 |
switch (m) { |
_ |
_ |
defaultStatement节点 |
switch (m) { |
switchBlock swb where swb contain defaultStatement; |
synchronizedBlock |
同步代码块 |
synchronized(i){ |
lock |
锁 |
任意节点 |
synchronized (i1) { |
synchronizedBlock sy where |
body |
执行语句 |
block语句块 |
synchronized (i2) { |
synchronizedBlock sy where |
|||
body.statementNum |
body语句块的语句数量 |
数值 |
synchronized (i2) { System.out.println("hello");} |
synchronizedBlock sb where sb.body.statementNum == 1; |
|||
firstStatement |
synchronizedBlock的第一条语句 |
任意节点 |
synchronized (i) { |
synchronizedBlock sb where |
|||
lastStatement |
synchronizedBlock的最后一条语句 |
任意节点 |
synchronized (i) { |
synchronizedBlock sb where |
|||
ternaryOperation |
条件表达式/三目运算 |
res = 2 > 2 ? true : false; |
condition |
三目运算的判断条件 |
binaryOperation |
boolean res = num > 1 ? true : false; |
ternaryOperation tp where |
thenExpression |
三目运算条件为真的操作 |
任意节点 |
boolean res = num > 1 ? true : false; |
ternaryOperation tp where |
|||
elseExpression |
三目运算条件为假的操作 |
任意节点 |
String str = num > 1 ? "true" : "false"; |
ternaryOperation tp where |
|||
unaryOperation |
一元表达式 |
a++; |
isPrefix |
是否运算符前置 |
布尔值 |
a++; |
unaryOperation uo where uo.isPrefix == false; |
operand |
操作对象 |
任意节点 |
i++; |
unaryOperation uo where uo.operand.name == "i"; |
|||
operator |
运算符 |
字符串 |
i++; |
unaryOperation uo where uo.operator == "++"; |
|||
variableAccess |
变量访问 |
int a = arr[3]; |
name |
变量名 |
字符串 |
int a = arr[3]; |
variableAccess va where va.name == "a"; |
variable |
被访问的变量的定义 |
variableDeclaration |
int a = arr[3]; |
variableAccess va where va.variable.name == "a"; |
|||
variableDeclaration |
变量声明 |
int a = arr[3]; |
name |
变量名 |
字符串 |
int a = arr[3]; |
variableDeclaration vd where vd.name == "a"; |
initializer |
初始化值 |
任意节点 |
int a = arr[3]; |
variableDeclaration vd where vd.initializer is arrayAccess; |
|||
valueUsages |
使用该变量的所有位置 |
任意节点 |
int a = arr[3]; |
variableDeclaration vd where |
|||
comment |
注释,包括行注释、块注释、javaDoc注释 |
// xxx |
content |
注释的内容 |
字符串 |
// function declaration |
comment cm where cm.content match ".*"; |
commentedNode |
被注释的节点 |
节点 |
// function declaration |
lineComment cm where cm.commentedNode is functionDeclaration; |
|||
lineComment |
行注释 |
// 注释 |
content |
注释的内容 |
字符串 |
// function declaration |
comment cm where cm.content match ".*function.*"; |
commentedNode |
被注释的节点 |
节点 |
// function declaration |
lineComment cm where cm.commentedNode is functionDeclaration; |
|||
blockComment |
块注释 |
/* 注释 */ |
content |
注释的内容 |
字符串 |
/* block comment */ |
blockComment bc where bc.content contain "block comment"; |
commentedNode |
被注释的节点 |
节点 |
/* block comment */ |
blockComment bc where bc.commentedNode contain variableDeclaration; |
|||
javadocComment |
javadoc注释 |
/** |
content |
注释的内容 |
字符串 |
/** |
javadocComment jd where jd.content contain "@since"; |
commentedNode |
被注释的节点 |
节点 |
/** |
javadocComment jd where |
- 点赞
- 收藏
- 关注作者
评论(0)