01: /*
02: * Copyright (c) 2002-2006 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.xwork.util;
06:
07: import ognl.ObjectPropertyAccessor;
08: import ognl.OgnlException;
09:
10: import java.util.Map;
11:
12: /**
13: * @author Gabe
14: */
15: public class XWorkObjectPropertyAccessor extends ObjectPropertyAccessor {
16: public Object getProperty(Map context, Object target, Object oname)
17: throws OgnlException {
18: //set the last set objects in the context
19: //so if the next objects accessed are
20: //Maps or Collections they can use the information
21: //to determine conversion types
22: context.put(XWorkConverter.LAST_BEAN_CLASS_ACCESSED, target
23: .getClass());
24: context.put(XWorkConverter.LAST_BEAN_PROPERTY_ACCESSED, oname
25: .toString());
26: OgnlContextState.updateCurrentPropertyPath(context, oname);
27: return super.getProperty(context, target, oname);
28: }
29: }
|