1 15 package org.apache.tapestry.listener; 16 17 import java.util.Map ; 18 19 import ognl.ObjectPropertyAccessor; 20 import ognl.OgnlException; 21 22 29 30 public class ListenerMapPropertyAccessor extends ObjectPropertyAccessor 31 { 32 36 37 public Object getProperty(Map context, Object target, Object name) throws OgnlException 38 { 39 ListenerMap map = (ListenerMap) target; 40 String listenerName = (String ) name; 41 42 if (map.canProvideListener(listenerName)) 43 return map.getListener(listenerName); 44 45 return super.getProperty(context, target, name); 46 } 47 48 52 53 public boolean hasGetProperty(Map context, Object target, Object oname) throws OgnlException 54 { 55 ListenerMap map = (ListenerMap) target; 56 String listenerName = (String ) oname; 57 58 if (map.canProvideListener(listenerName)) 59 return true; 60 61 return super.hasGetProperty(context, target, oname); 62 } 63 64 } | Popular Tags |