1   /*
2    * Copyright 2005 (C) Our Community Pty. Ltd. All Rights Reserved
3    * 
4    * $Id$
5    */
6   
7   package org.springframework.binding.form.support;
8   
9   import org.springframework.beans.BeansException;
10  import org.springframework.binding.support.BeanPropertyAccessStrategy;
11  import org.springframework.binding.value.ValueModel;
12  
13  public class TestPropertyAccessStrategy extends BeanPropertyAccessStrategy {
14      
15      private int numValueModelRequests;
16      private String lastRequestedValueModel;
17  
18      public TestPropertyAccessStrategy(Object bean) {
19          super(bean);
20      }
21  
22      public ValueModel getPropertyValueModel(String propertyPath) throws BeansException {
23          numValueModelRequests++;
24          lastRequestedValueModel = propertyPath;
25          return super.getPropertyValueModel(propertyPath);
26      }
27      
28      public int numValueModelRequests() {
29          return numValueModelRequests;
30      }
31  
32      public String lastRequestedValueModel() {
33          return lastRequestedValueModel;
34      }
35  }