代码地方
rg.apache.ibatis.reflection:ParamNameResolver:ParamNameResolver
final Class<?>[] paramTypes = method.getParameterTypes(); final Annotation[][] paramAnnotations = method.getParameterAnnotations(); final SortedMap<Integer, String> map = new TreeMap<>(); int paramCount = paramAnnotations.length; // get names from @Param annotations 获取方法的param注解 for (int paramIndex = 0; paramIndex < paramCount; paramIndex++) { if (isSpecialParameter(paramTypes[paramIndex])) { // skip special parameters continue; } String name = null; for (Annotation annotation : paramAnnotations[paramIndex]) { if (annotation instanceof Param) { hasParamAnnotation = true; name = ((Param) annotation).value(); break; } } if (name == null) { // @Param was not specified. if (config.isUseActualParamName()) { //如果使用 useActualParamName 实际方法名 生成arg0 ,arg1 等 name = getActualParamName(method, paramIndex); } if (name == null) { // use the parameter index as the name ("0", "1", ...) // gcode issue #71 否则使用编号作为名字 name = String.valueOf(map.size()); } } map.put(paramIndex, name); // 索引和Param 值放到map中 } names = Collections.unmodifiableSortedMap(map);