}
if (matcher.group(2) == null) {
return linkRenderer.link(new TypeMetaData(className), listener);
}
ClassMetaData targetClass;
if (className != null) {
targetClass = repository.find(className);
if (targetClass == null) {
return null;
}
} else {
targetClass = classMetaData;
}
String methodSignature = matcher.group(3);
if (matcher.group(5) != null) {
StringBuilder signature = new StringBuilder();
signature.append(methodSignature);
signature.append("(");
if (matcher.group(5).length() > 0) {
String[] types = PARAM_DELIMITER.split(matcher.group(5));
for (int i = 0; i < types.length; i++) {
String type = types[i];
Matcher typeMatcher = TYPE_PATTERN.matcher(type);
if (!typeMatcher.matches()) {
return null;
}
if (i > 0) {
signature.append(", ");
}
signature.append(typeNameResolver.resolve(typeMatcher.group(1), classMetaData));
String suffix = typeMatcher.group(2);
if (suffix.equals("...")) {
suffix = "[]";
}
signature.append(suffix);
}
}
signature.append(")");
methodSignature = signature.toString();
}
if (targetClass.isEnum() && targetClass.getEnumConstant(methodSignature) != null) {
return linkRenderer.link(targetClass.getEnumConstant(methodSignature), listener);
}
MethodMetaData method = findMethod(methodSignature, targetClass);
if (method == null) {
return null;