01: /*
02: * Copyright 2005-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
05: * in compliance with the License. You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software distributed under the License
10: * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11: * or implied. See the License for the specific language governing permissions and limitations under
12: * the License.
13: */
14:
15: package org.strecks.bind.handler;
16:
17: import org.strecks.converter.Converter;
18:
19: /**
20: * Defines interface for performing bindings to and from target bean to bindable object
21: *
22: * @author Phil Zoio
23: */
24: public interface BindHandler {
25:
26: /**
27: * Binds from <code>sourcePropertyName</code> in the <code>bean</code> bean. Note that the property contains a
28: * <code>getXXX()</code> method with an annotation which defines the target property of the binding
29: * @param actionBean
30: * the action bean
31: * @param convertedValue
32: * if conversion has already taken placed during a validation step, the converted value will be passed in
33: * here. This value can be used instead of executing conversion code in the <code>BindHandler</code>
34: */
35: public void bindInwards(Object form, Object actionBean,
36: Object convertedValue);
37:
38: /**
39: * Binds to <code>targetPropertyName</code> in the <code>bean</code>. Note that the property contains a
40: * <code>getXXX()</code> method with an annotation which defines the target property of the binding
41: * @param actionBean
42: * the action bean the action bean
43: *
44: */
45: public void bindOutwards(Object form, Object actionBean);
46:
47: /**
48: * Returns the converter class registered with the <code>BindHandler</code> instance. May return null
49: */
50: public Converter getConverter();
51:
52: }
|