I have generic class ObjectDaoReflect<T extends BaseEntity>
it work with reflaction, because of type erasure it have constructor with generic class parameter public ObjectDaoReflect(Class<T> objectClass)
. My idea is add custom logic before bean instancing by spring (its prototype bean), and read generic information about Field in which spring is going to inject my bean, using this code I can read genereic field class
(Class<?>) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0]
and I like pass it to my bean constructor. Is there way to add this custom logic before bean autowired ? In general I need read field in what spring is going to inject my bean, read its generic type and pass it to my bean constructor (or setter). Is there any example of this ? Or maybe I need to use my custom annotation instead autowired and use BeanPostProcessor postProcessBeforeInitialization ?