@Test public void nestedBindingWithDisabledAutoGrow() throws Exception { FieldAccessBean rod = new FieldAccessBean(); DataBinder binder = new DataBinder(rod, "person"); binder.setAutoGrowNestedPaths(false); binder.initDirectFieldAccess(); MutablePropertyValues pvs = new MutablePropertyValues(); pvs.addPropertyValue(new PropertyValue("spouse.name", "Kerry")); thrown.expect(NullValueInNestedPathException.class); binder.bind(pvs); }
private void doBind(Object bean, NacosConfigurationProperties properties, PropertyValues propertyValues) { DataBinder dataBinder = new DataBinder(bean); dataBinder.setAutoGrowNestedPaths(properties.ignoreNestedProperties()); dataBinder.setIgnoreInvalidFields(properties.ignoreInvalidFields()); dataBinder.setIgnoreUnknownFields(properties.ignoreUnknownFields()); dataBinder.bind(propertyValues); }
private void doBind(Object bean, NacosConfigurationProperties properties, PropertyValues propertyValues) { DataBinder dataBinder = new DataBinder(bean); dataBinder.setAutoGrowNestedPaths(properties.ignoreNestedProperties()); dataBinder.setIgnoreInvalidFields(properties.ignoreInvalidFields()); dataBinder.setIgnoreUnknownFields(properties.ignoreUnknownFields()); dataBinder.bind(propertyValues); }
dataBinder.setValidator(validator); dataBinder.setConversionService(play.data.format.Formatters.conversion); dataBinder.setAutoGrowNestedPaths(true); dataBinder.bind(new MutablePropertyValues(objectData)); Set<ConstraintViolation<Object>> validationErrors;
private DataBinder dataBinder(String... allowedFields) { DataBinder dataBinder; if (rootName == null) { dataBinder = new DataBinder(blankInstance()); } else { dataBinder = new DataBinder(blankInstance(), rootName); } if (allowedFields.length > 0) { dataBinder.setAllowedFields(allowedFields); } SpringValidatorAdapter validator = new SpringValidatorAdapter(this.validatorFactory.getValidator()); dataBinder.setValidator(validator); dataBinder.setConversionService(formatters.conversion); dataBinder.setAutoGrowNestedPaths(true); if(this.directFieldAccess) { // FYI: initBeanPropertyAccess() is the default, let's switch to direct field access instead dataBinder.initDirectFieldAccess(); // this should happen last, when everything else was set on the dataBinder already } return dataBinder; }
private DataBinder dataBinder(String... allowedFields) { DataBinder dataBinder; if (rootName == null) { dataBinder = new DataBinder(blankInstance()); } else { dataBinder = new DataBinder(blankInstance(), rootName); } if (allowedFields.length > 0) { dataBinder.setAllowedFields(allowedFields); } SpringValidatorAdapter validator = new SpringValidatorAdapter(this.validatorFactory.getValidator()); dataBinder.setValidator(validator); dataBinder.setConversionService(formatters.conversion); dataBinder.setAutoGrowNestedPaths(true); if(this.directFieldAccess) { // FYI: initBeanPropertyAccess() is the default, let's switch to direct field access instead dataBinder.initDirectFieldAccess(); // this should happen last, when everything else was set on the dataBinder already } return dataBinder; }
private DataBinder dataBinder(String... allowedFields) { DataBinder dataBinder; if (rootName == null) { dataBinder = new DataBinder(blankInstance()); } else { dataBinder = new DataBinder(blankInstance(), rootName); } if (allowedFields.length > 0) { dataBinder.setAllowedFields(allowedFields); } SpringValidatorAdapter validator = new SpringValidatorAdapter(this.validatorFactory.getValidator()); dataBinder.setValidator(validator); dataBinder.setConversionService(formatters.conversion); dataBinder.setAutoGrowNestedPaths(true); if(this.directFieldAccess) { // FYI: initBeanPropertyAccess() is the default, let's switch to direct field access instead dataBinder.initDirectFieldAccess(); // this should happen last, when everything else was set on the dataBinder already } return dataBinder; }
dataBinder.setValidator(validator); dataBinder.setConversionService(play.data.format.Formatters.conversion); dataBinder.setAutoGrowNestedPaths(true); dataBinder.bind(new MutablePropertyValues(objectData)); Set<ConstraintViolation<Object>> validationErrors;