1 15 package org.apache.tapestry.bean; 16 17 import java.util.Map ; 18 19 import ognl.ObjectPropertyAccessor; 20 import ognl.OgnlException; 21 22 import org.apache.tapestry.IBeanProvider; 23 24 36 37 public class BeanProviderPropertyAccessor extends ObjectPropertyAccessor 38 { 39 45 46 public Object getProperty(Map context, Object target, Object name) throws OgnlException 47 { 48 IBeanProvider provider = (IBeanProvider)target; 49 String beanName = (String )name; 50 51 if (provider.canProvideBean(beanName)) 52 return provider.getBean(beanName); 53 54 return super.getProperty(context, target, name); 55 } 56 57 62 63 public boolean hasGetProperty(Map context, Object target, Object oname) throws OgnlException 64 { 65 IBeanProvider provider = (IBeanProvider)target; 66 String beanName = (String )oname; 67 68 if (provider.canProvideBean(beanName)) 69 return true; 70 71 return super.hasGetProperty(context, target, oname); 72 } 73 74 } 75 | Popular Tags |