@Test public void testSetBeanProperties() { Bean bean = new Bean(); Properties p = new Properties(); p.setProperty("prop", "0"); p.setProperty("prop1", "1"); p.setProperty("prop2", "2"); p.setProperty("prop3", "3"); p = new Properties(p); p.put("object", new Object()); PropertiesUtils.setBeanProperties(bean, p, null); assertEquals(0, bean.getProp()); assertEquals("1", bean.getProp1()); assertEquals(2d, bean.getProp2(), 0); assertEquals(Arrays.asList("3"), bean.getProp3()); p.setProperty("prop", "?"); try { PropertiesUtils.setBeanProperties(bean, p, null); fail("expected exception"); } catch (InvalidPropertyException e) { } }
public static void setBeanProperties(Object bean, Properties props, String prefix) { setBeanProperties(bean, props, prefix, false); }
PropertiesUtils { public static void setBeanProperties(Object bean, Properties props, String prefix) { setBeanProperties(bean, props, prefix, false); } }
PropertiesUtils { public static void setBeanProperties(Object bean, Properties props, String prefix) { setBeanProperties(bean, props, prefix, false); }  }
PropertiesUtils { public static void setBeanProperties(Object bean, Properties props, String prefix) { setBeanProperties(bean, props, prefix, false); }  static Properties clone( Properties props ); static Properties clone( Properties props, Properties defaults, boolean deepClone ); static void putAll(Properties addToThis,
                              Properties withThese); static int getIntProperty(Properties props, String propName, int defaultValue); static long getLongProperty(Properties props, String propName, long defaultValue); static float getFloatProperty(Properties props, String propName, float defaultValue); static double getDoubleProperty(Properties props, String propName, double defaultValue); static boolean getBooleanProperty(Properties props, String propName, boolean defaultValue); static Properties load(String fileName); static char toHex(int nibble); static String toHex(byte[] bytes); static byte[] fromHex(String hex); static void toHex(StringBuilder sb, InputStream is); static void setBeanProperties(Object bean, Properties props, String prefix); static void setBeanProperties(Object bean, Properties props, String prefix, boolean includeEnv); static void setBeanProperty(Object bean, String name, Object value); static String getHierarchicalProperty(String key, String defaultValue); static T getHierarchicalProperty(String key, T defaultValue, Class<T> clazz); static Properties getDefaultProperties(); }
PropertiesUtils { public static void setBeanProperties(Object bean, Properties props, String prefix) { setBeanProperties(bean, props, prefix, false); }  static Properties clone( Properties props ); static Properties clone( Properties props, Properties defaults, boolean deepClone ); static void putAll(Properties addToThis,
                              Properties withThese); static int getIntProperty(Properties props, String propName, int defaultValue); static long getLongProperty(Properties props, String propName, long defaultValue); static float getFloatProperty(Properties props, String propName, float defaultValue); static double getDoubleProperty(Properties props, String propName, double defaultValue); static boolean getBooleanProperty(Properties props, String propName, boolean defaultValue); static Properties load(String fileName); static char toHex(int nibble); static String toHex(byte[] bytes); static byte[] fromHex(String hex); static void toHex(StringBuilder sb, InputStream is); static void setBeanProperties(Object bean, Properties props, String prefix); static void setBeanProperties(Object bean, Properties props, String prefix, boolean includeEnv); static void setBeanProperty(Object bean, String name, Object value); static String getHierarchicalProperty(String key, String defaultValue); static T getHierarchicalProperty(String key, T defaultValue, Class<T> clazz); static Properties getDefaultProperties();  }