use of cn.taketoday.beans.BeanMetadata in project today-framework by TAKETODAY.
the class DataBinderParameterResolver method resolveParameter.
/**
* @return Pojo parameter
*/
@Override
public Object resolveParameter(final RequestContext context, final ResolvableMethodParameter resolvable) throws Throwable {
final Class<?> parameterClass = resolvable.getParameterType();
BeanMetadata beanMetadata = BeanMetadata.from(parameterClass);
Object target = beanMetadata.newInstance();
RequestContextDataBinder dataBinder = new RequestContextDataBinder(target, resolvable.getName());
dataBinder.setConversionService(conversionService);
dataBinder.bind(context);
// #30 Support annotation-supported in the form of DataBinder
resolveAnnotatedProperty(context, resolvable, dataBinder);
// todo dataBinder.validate();
return target;
}
Aggregations