/** * Puts all of the writable properties from the given BeanMap into this * BeanMap. Read-only and Write-only properties will be ignored. * * @param map the BeanMap whose properties to put */ public void putAllWriteable(final BeanMap map) { final Iterator<?> readableKeys = map.readMethods.keySet().iterator(); while (readableKeys.hasNext()) { final Object key = readableKeys.next(); if (getWriteMethod(key) != null) { this.put(key, map.get(key)); } } }
/** * Puts all of the writable properties from the given BeanMap into this * BeanMap. Read-only and Write-only properties will be ignored. * * @param map the BeanMap whose properties to put */ public void putAllWriteable(final BeanMap map) { final Iterator<?> readableKeys = map.readMethods.keySet().iterator(); while (readableKeys.hasNext()) { final Object key = readableKeys.next(); if (getWriteMethod(key) != null) { this.put(key, map.get(key)); } } }
final Object key = readableKeys.next(); if(getWriteMethod(key) != null) { newMap.put(key, get(key));
final Object key = readableKeys.next(); if(getWriteMethod(key) != null) { newMap.put(key, get(key));
/** * Sets the value. * * @param value the new value for the entry * @return the old value for the entry */ @Override public Object setValue(final Object value) { final Object key = getKey(); final Object oldValue = owner.get( key ); owner.put( key, value ); final Object newValue = owner.get( key ); super.setValue( newValue ); return oldValue; } }
/** * Sets the value. * * @param value the new value for the entry * @return the old value for the entry */ @Override public Object setValue(final Object value) { final Object key = getKey(); final Object oldValue = owner.get( key ); owner.put( key, value ); final Object newValue = owner.get( key ); super.setValue( newValue ); return oldValue; } }
/** * Puts all of the writable properties from the given BeanMap into this * BeanMap. Read-only and Write-only properties will be ignored. * * @param map the BeanMap whose properties to put */ public void putAllWriteable(final BeanMap map) { final Iterator<?> readableKeys = map.readMethods.keySet().iterator(); while (readableKeys.hasNext()) { final Object key = readableKeys.next(); if (getWriteMethod(key) != null) { this.put(key, map.get(key)); } } }
/** * Puts all of the writable properties from the given BeanMap into this * BeanMap. Read-only and Write-only properties will be ignored. * * @param map the BeanMap whose properties to put */ public void putAllWriteable(BeanMap map) { Iterator readableKeys = map.readMethods.keySet().iterator(); while (readableKeys.hasNext()) { Object key = readableKeys.next(); if (getWriteMethod(key) != null) { this.put(key, map.get(key)); } } }
/** * Puts all of the writable properties from the given BeanMap into this * BeanMap. Read-only and Write-only properties will be ignored. * * @param map the BeanMap whose properties to put */ public void putAllWriteable(BeanMap map) { Iterator readableKeys = map.readMethods.keySet().iterator(); while (readableKeys.hasNext()) { Object key = readableKeys.next(); if (getWriteMethod(key) != null) { this.put(key, map.get(key)); } } }
/** * Puts all of the writable properties from the given BeanMap into this * BeanMap. Read-only and Write-only properties will be ignored. * * @param map the BeanMap whose properties to put */ public void putAllWriteable(BeanMap map) { Iterator readableKeys = map.readMethods.keySet().iterator(); while (readableKeys.hasNext()) { Object key = readableKeys.next(); if (getWriteMethod(key) != null) { this.put(key, map.get(key)); } } }
Object key = readableKeys.next(); if(getWriteMethod(key) != null) { newMap.put(key, get(key));
Object key = readableKeys.next(); if(getWriteMethod(key) != null) { newMap.put(key, get(key));
bm.put(name, value);
final Object key = readableKeys.next(); if(getWriteMethod(key) != null) { newMap.put(key, get(key));
/** * Sets the value. * * @param value the new value for the entry * @return the old value for the entry */ public Object setValue(Object value) { Object key = getKey(); Object oldValue = owner.get( key ); owner.put( key, value ); Object newValue = owner.get( key ); super.setValue( newValue ); return oldValue; } }
/** * Sets the value. * * @param value the new value for the entry * @return the old value for the entry */ public Object setValue(Object value) { Object key = getKey(); Object oldValue = owner.get( key ); owner.put( key, value ); Object newValue = owner.get( key ); super.setValue( newValue ); return oldValue; } }
/** * Sets the value. * * @param value the new value for the entry * @return the old value for the entry */ public Object setValue(Object value) { Object key = getKey(); Object oldValue = owner.get( key ); owner.put( key, value ); Object newValue = owner.get( key ); super.setValue( newValue ); return oldValue; } }
/** * Set properties derived from configuration on a bean. * * <ul> * <li>[prefix].property.* gives the properties to set.</li> * </ul> * * @param bean the bean to set properties on. * @param configuration the configuration to derive properties from. * @param prefix the property prefix. */ public static void setPropertiesFromConfiguration(Object bean, Configuration configuration, String prefix) { BeanMap beanMap = new BeanMap(bean); Properties properties = SeedConfigurationUtils.buildPropertiesFromConfiguration(configuration, prefix); for (String key : properties.stringPropertyNames()) { String value = properties.getProperty(key); try { PropertyDescriptor propertyDescriptor = PropertyUtils.getPropertyDescriptor(bean, key); if (propertyDescriptor == null) { throw SeedException.createNew(CoreUtilsErrorCode.PROPERTY_NOT_FOUND).put("property", key).put("class", bean.getClass().getCanonicalName()); } beanMap.put(key,value); } catch (Exception e) { throw SeedException.wrap(e, CoreUtilsErrorCode.UNABLE_TO_SET_PROPERTY).put("property", key).put("class", bean.getClass().getCanonicalName()).put("value", value); } } }
/** * Sets the value. * * @param value the new value for the entry * @return the old value for the entry */ @Override public Object setValue(final Object value) { final Object key = getKey(); final Object oldValue = owner.get( key ); owner.put( key, value ); final Object newValue = owner.get( key ); super.setValue( newValue ); return oldValue; } }