* In case of constructor injection, search for the data binder parameter annotated with @AutoBound
*/
Statement dataBinderRef = null;
MetaClass dataModelType = null;
BeanMetric beanMetric = InjectUtil.analyzeBean(ctx.getInjectionContext(), ctx.getEnclosingType());
MetaConstructor mc = beanMetric.getInjectorConstructor();
if (mc != null) {
for (MetaParameter mp : mc.getParameters()) {
if (mp.getType().getErased().isAssignableTo(MetaClassFactory.get(DataBinder.class))
&& mp.isAnnotationPresent(AutoBound.class)) {
dataModelType = (MetaClass) mp.getType().getParameterizedType().getTypeParameters()[0];
if (dataBinderRef != null) {
throw new GenerationException("Multiple @AutoBound data binders found in constructor of " +
mc.getDeclaringClass());
}
dataBinderRef = ctx.getInjectionContext().getInlineBeanReference(mp);
}
}
}