1 3 package jodd.bean; 4 5 11 public class BeanStackUtil { 12 13 public static void setProperty(Object [] stack, String property, Object value) { 14 for (int i = 0; i < stack.length; i++) { 15 Object bean = stack[i]; 16 if (bean != null) { 17 try { 18 BeanUtil.setProperty(bean, property, value); 19 return; 20 } catch (BeanException bex) { 21 } 23 } 24 } 25 throw new BeanException("Unable to set bean stack property '" + property + '\''); 26 } 27 28 public static Object getProperty(Object [] stack, String property) { 29 for (int i = 0; i < stack.length; i++) { 30 Object bean = stack[i]; 31 if (bean != null) { 32 try { 33 return BeanUtil.getProperty(bean, property); 34 } catch (BeanException bex) { 35 } 37 } 38 } 39 throw new BeanException("Unable to read bean stack property '" + property + '\''); 40 } 41 } 42 | Popular Tags |