Spring syntax for setting a Class object?

后端 未结 4 1604
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-01 09:57

Is there a way to set a property in spring to, not an instance of a class, but the class object itself? i.e.

Rather than


   

        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-01 10:45

    You could certainly use the static factory method Class.forName(), if there's no more elegant syntax (and I don't believe there is):

    
       
          
       
    
    

提交回复
热议问题