1   /*
2    * Copyright 2002-2005 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5    * use this file except in compliance with the License. You may obtain a copy of
6    * the License at
7    * 
8    * http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations under
14   * the License.
15   */
16  package org.springframework.binding.form.support;
17  
18  import org.springframework.binding.MutablePropertyAccessStrategy;
19  import org.springframework.binding.value.ValueModel;
20  
21  public class TestAbstractFormModel extends AbstractFormModel {
22  
23      int preProcessCalls;
24  
25      int postProcessCalls;
26  
27      public TestAbstractFormModel(Object formObject) {
28          super(formObject);
29      }
30  
31      public TestAbstractFormModel(MutablePropertyAccessStrategy propertyAccessStrategy, boolean buffered) {
32          super(propertyAccessStrategy, buffered);
33      }
34  
35      public TestAbstractFormModel(ValueModel formObjectHolder, boolean buffering) {
36          super(formObjectHolder, buffering);
37      }
38  
39      protected ValueModel preProcessNewValueModel(String domainObjectProperty, ValueModel formValueModel) {
40          ++preProcessCalls;
41          return formValueModel;
42      }
43  
44      protected void postProcessNewValueModel(String domainObjectProperty, ValueModel valueModel) {
45          ++postProcessCalls;
46      }
47  
48      protected ValueModel preProcessNewConvertingValueModel(String formProperty, Class targetClass,
49              ValueModel formValueModel) {
50          ++preProcessCalls;
51          return formValueModel;
52      }
53  
54      protected void postProcessNewConvertingValueModel(String formProperty, Class targetClass, ValueModel valueModel) {
55          ++postProcessCalls;
56      }
57  }