The parent class declares generics
example: class A extends B <C> {} class B<T> { List<T> lists; } class C { String name; }
This commit is contained in:
parent
ea3d13a9b5
commit
fe3765f1cb
|
@ -82,6 +82,13 @@ public class ParamsBuildHelper {
|
|||
String simpleName = DocClassUtil.getSimpleName(className);
|
||||
String[] globGicName = DocClassUtil.getSimpleGicName(className);
|
||||
JavaClass cls = projectBuilder.getClassByName(simpleName);
|
||||
if (globGicName == null || globGicName.length <= 0) {
|
||||
//获取父类的泛型
|
||||
JavaClass superJavaClass = cls != null ? cls.getSuperJavaClass() : null;
|
||||
if (superJavaClass != null && !"Object".equals(superJavaClass.getSimpleName())) {
|
||||
globGicName = DocClassUtil.getSimpleGicName(superJavaClass.getGenericFullyQualifiedName());
|
||||
}
|
||||
}
|
||||
|
||||
JavaClassUtil.genericParamMap(genericMap, cls, globGicName);
|
||||
List<DocJavaField> fields = JavaClassUtil.getFields(cls, 0, new LinkedHashMap<>());
|
||||
|
|
Loading…
Reference in New Issue