@Override
public void visit(MethodDeclaration method, A result) {
if (CollectionUtils.isEmpty(method.getAnnotations())) {
return;
}
for (AnnotationExpr annotation : method.getAnnotations()) {
if (!annotation.getClass().equals(NormalAnnotationExpr.class)) {
continue;
}
NormalAnnotationExpr annot = (NormalAnnotationExpr) annotation;
if (annot.getName().toString().equals(SampleCode.class.getSimpleName())
&& !CollectionUtils.isEmpty(annot.getPairs())) {
for (MemberValuePair pair : annot.getPairs()) {
if (StringUtils.equals(pair.getName(), "api") && !StringUtils.isBlank(pair.getValue().toString())) {
result.put(getCacheRowKey(type, pair.getValue().toString().replace("\"", "")), stripTestPrefix(method.getName()),
stripCurlyBrackets(method.getBody().toString()));
return;
}
}
}
}
}
}