in maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoClassVisitor.java [176:199]
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
if ((access & Opcodes.ACC_PUBLIC) != Opcodes.ACC_PUBLIC
|| (access & Opcodes.ACC_STATIC) == Opcodes.ACC_STATIC) {
return null;
}
if (name.length() < 4 || !(name.startsWith("add") || name.startsWith("set"))) {
return null;
}
Type type = Type.getType(desc);
if ("void".equals(type.getReturnType().getClassName()) && type.getArgumentTypes().length == 1) {
String fieldName = StringUtils.lowercaseFirstLetter(name.substring(3));
String className = type.getArgumentTypes()[0].getClassName();
List<String> typeParameters = extractTypeParameters(access, signature, false);
MojoMethodVisitor mojoMethodVisitor = new MojoMethodVisitor(fieldName, className, typeParameters);
methodVisitors.add(mojoMethodVisitor);
return mojoMethodVisitor;
}
return null;
}