@Test void populate() throws PropertyException { TestBean beanTest = new TestBean(); Map<String, String> values = new HashMap<>(); values.put("lowerprop", "lowerpropvalue"); values.put("upperprop", "upperPropvalue"); values.put("prop2", "42"); values.put("prop3", "true"); values.put("hiddenProperty", "hiddenPropertyvalue"); values.put("publicField", "publicFieldvalue"); values.put("genericProp", "1,2"); this.defaultBeanManager.populate(beanTest, values); assertEquals("lowerpropvalue", beanTest.getLowerprop()); assertEquals("upperPropvalue", beanTest.getUpperProp()); assertEquals(42, beanTest.getProp2()); assertTrue(beanTest.getProp3()); assertNull(beanTest.getHiddenProperty()); assertEquals("publicFieldvalue", beanTest.publicField); assertEquals(Arrays.asList(1, 2), beanTest.getGenericProp()); }
@Override public void populate(Object bean, Map<String, ?> values) throws PropertyException { Map<String, Object> remainingValues = new HashMap<>(values); populateBean(bean, remainingValues); if (!remainingValues.isEmpty() && bean instanceof RawProperties) { RawProperties rawProperties = (RawProperties) bean; for (Map.Entry<String, Object> entry : remainingValues.entrySet()) { rawProperties.set(entry.getKey(), entry.getValue()); } } validateBean(bean); }
DefaultBeanManager implements BeanManager { @Override public void populate(Object bean, Map<String, ?> values) throws PropertyException { Map<String, Object> remainingValues = new HashMap<>(values); populateBean(bean, remainingValues); if (!remainingValues.isEmpty() && bean instanceof RawProperties) { RawProperties rawProperties = (RawProperties) bean; for (Map.Entry<String, Object> entry : remainingValues.entrySet()) { rawProperties.set(entry.getKey(), entry.getValue()); } } validateBean(bean); } }
DefaultBeanManager implements BeanManager { @Override public void populate(Object bean, Map<String, ?> values) throws PropertyException { Map<String, Object> remainingValues = new HashMap<>(values); populateBean(bean, remainingValues); if (!remainingValues.isEmpty() && bean instanceof RawProperties) { RawProperties rawProperties = (RawProperties) bean; for (Map.Entry<String, Object> entry : remainingValues.entrySet()) { rawProperties.set(entry.getKey(), entry.getValue()); } } validateBean(bean); }  }
DefaultBeanManager implements BeanManager { @Override public void populate(Object bean, Map<String, ?> values) throws PropertyException { Map<String, Object> remainingValues = new HashMap<>(values); populateBean(bean, remainingValues); if (!remainingValues.isEmpty() && bean instanceof RawProperties) { RawProperties rawProperties = (RawProperties) bean; for (Map.Entry<String, Object> entry : remainingValues.entrySet()) { rawProperties.set(entry.getKey(), entry.getValue()); } } validateBean(bean); }  ValidatorFactory getValidatorFactory(); @Override void populate(Object bean, Map<String, ?> values); @Override BeanDescriptor getBeanDescriptor(Class<?> beanClass); }
DefaultBeanManager implements BeanManager { @Override public void populate(Object bean, Map<String, ?> values) throws PropertyException { Map<String, Object> remainingValues = new HashMap<>(values); populateBean(bean, remainingValues); if (!remainingValues.isEmpty() && bean instanceof RawProperties) { RawProperties rawProperties = (RawProperties) bean; for (Map.Entry<String, Object> entry : remainingValues.entrySet()) { rawProperties.set(entry.getKey(), entry.getValue()); } } validateBean(bean); }  ValidatorFactory getValidatorFactory(); @Override void populate(Object bean, Map<String, ?> values); @Override BeanDescriptor getBeanDescriptor(Class<?> beanClass);  }