1 15 package org.apache.tapestry.bean; 16 17 import org.apache.hivemind.ApplicationRuntimeException; 18 import org.apache.hivemind.impl.BaseLocatable; 19 import org.apache.hivemind.util.Defense; 20 import org.apache.hivemind.util.PropertyUtils; 21 import org.apache.tapestry.IBeanProvider; 22 23 30 public class LightweightBeanInitializer extends BaseLocatable implements IBeanInitializer 31 { 32 private final String _initializer; 33 34 public LightweightBeanInitializer(String initializer) 35 { 36 Defense.notNull(initializer, "initializer"); 37 38 _initializer = initializer; 39 } 40 41 public void setBeanProperty(IBeanProvider provider, Object bean) 42 { 43 try 44 { 45 PropertyUtils.configureProperties(bean, _initializer); 46 } 47 catch (Exception ex) 48 { 49 throw new ApplicationRuntimeException(ex.getMessage(), getLocation(), ex); 50 } 51 } 52 53 56 public String getPropertyName() 57 { 58 return _initializer; 59 } 60 61 } 62 | Popular Tags |