我想知道是否可以从 Java 类型创建实例并填充参数化列表?
我有一个UserDefinedType
带有成员变量的类型List<AnotherUserDefinedType> list
的类型(以及一些原始类型)
使用反射(处理自定义注释)UserDefinedType
我只处理具有特定注释的成员变量。如果在注解上设置了特定属性,则意味着它AnotherUserDefinedType
与原始类型相反,因此处理方式不同。在这种情况下,我将完全按照我所做的UserDefinedType
.
需要注意的是,我必须创建AnotherUserDefinedType
from的一个实例Field.getGenericType()
,并以某种方式将它们添加到参数化类型List<AnotherUserDefinedType>
和 callUserDefinedType.setAnotherUserDefinedType(List<AnotherUserDefinedType> list)
中。
我试图找到一些关于它的信息,但现在不知所措。任何援助将不胜感激。