Dynamically create an object in java from a class name and set class fields by using a List with data

前端 未结 3 1034
一向
一向 2020-12-02 10:55

I have a List that contains data with String type -> [\"classField1\", \"classField2\", \"classField3\"]

I have a method (myMethod(List list, Stri

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-02 11:17

    Take a look at the http://commons.apache.org/beanutils/ package. It allows to access fields by name.

提交回复
热议问题