/** * Return a comma-separated String of r/w properties of the specified object. * @param obj the object to introspect. * @return a a comma-separated String of r/w properties. */ public static String propertiesToString(Object obj) { StringBuilder sb = new StringBuilder(); Map<String, Object> properties = new TreeMap<String, Object>(getProperties(obj)); Iterator<String> it = properties.keySet().iterator(); while (it.hasNext()) { String property = it.next(); Object val = getProperty(obj, property); sb.append(property); sb.append("="); sb.append(val); if (it.hasNext()) { sb.append(", "); } } return sb.toString(); }
/** * Return a comma-separated String of r/w properties of the specified object. * @param obj the object to introspect. * @return a a comma-separated String of r/w properties. */ public static String propertiesToString(Object obj) { StringBuffer sb = new StringBuffer(); Map properties = new TreeMap(getProperties(obj)); Iterator it = properties.keySet().iterator(); while (it.hasNext()) { String property = (String) it.next(); Object val = getProperty(obj, property); sb.append(property); sb.append("="); sb.append(val); if (it.hasNext()) sb.append(", "); } return sb.toString(); }
/** * Return a comma-separated String of r/w properties of the specified object. * @param obj the object to introspect. * @return a a comma-separated String of r/w properties. */ public static String propertiesToString(Object obj) { StringBuilder sb = new StringBuilder(); Map<String, Object> properties = new TreeMap<String, Object>(getProperties(obj)); Iterator<String> it = properties.keySet().iterator(); while (it.hasNext()) { String property = it.next(); Object val = getProperty(obj, property); sb.append(property); sb.append("="); sb.append(val); if (it.hasNext()) { sb.append(", "); } } return sb.toString(); }
/** * Return a comma-separated String of r/w properties of the specified object. * @param obj the object to introspect. * @return a a comma-separated String of r/w properties. */ public static String propertiesToString(Object obj) { StringBuffer sb = new StringBuffer(); Map properties = new TreeMap(getProperties(obj)); Iterator it = properties.keySet().iterator(); while (it.hasNext()) { String property = (String) it.next(); Object val = getProperty(obj, property); sb.append(property); sb.append("="); sb.append(val); if (it.hasNext()) sb.append(", "); } return sb.toString(); }
Map properties = PropertyUtils.getProperties(resource); StringBuilder sb = new StringBuilder(); Iterator it2 = properties.entrySet().iterator();
Map properties = PropertyUtils.getProperties(resource); StringBuffer sb = new StringBuffer(); Iterator it2 = properties.entrySet().iterator();
Map properties = PropertyUtils.getProperties(resource); StringBuilder sb = new StringBuilder(); Iterator it2 = properties.entrySet().iterator();
Map properties = PropertyUtils.getProperties(resource); StringBuffer sb = new StringBuffer(); Iterator it2 = properties.entrySet().iterator();
public PoolingDataSource getObject() throws Exception { if (ds == null) { ds = new PoolingDataSource(); PropertyUtils.setProperties(ds, PropertyUtils.getProperties(this)); log.debug("Initializing PoolingDataSource with id '{}'", ds.getUniqueName()); ds.init(); } return ds; }
public void testSmartGetProperties() throws Exception { Destination destination = new Destination(); destination.setAnInteger(10); destination.setABoolean(true); Properties props = new Properties(); props.setProperty("number1", "one"); props.setProperty("number2", "two"); destination.setProps(props); Map map = PropertyUtils.getProperties(destination); assertEquals(13, map.size()); assertEquals("one", map.get("props.number1")); assertEquals("two", map.get("props.number2")); assertEquals(new Integer(10), map.get("anInteger")); assertEquals(Boolean.TRUE, map.get("aBoolean")); assertEquals(Boolean.FALSE, map.get("anotherBoolean")); assertNull(map.get("subDestination")); }
public void testSmartGetProperties() throws Exception { Destination destination = new Destination(); destination.setAnInteger(10); destination.setABoolean(true); Properties props = new Properties(); props.setProperty("number1", "one"); props.setProperty("number2", "two"); destination.setProps(props); Map map = PropertyUtils.getProperties(destination); assertEquals(13, map.size()); assertEquals("one", map.get("props.number1")); assertEquals("two", map.get("props.number2")); assertEquals(new Integer(10), map.get("anInteger")); assertEquals(Boolean.TRUE, map.get("aBoolean")); assertEquals(Boolean.FALSE, map.get("anotherBoolean")); assertNull(map.get("subDestination")); }