View Javadoc

1   /*
2    * Copyright 2004-2008 the Seasar Foundation and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of 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,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.seasar.uruma.binding.value;
17  
18  import java.lang.reflect.Field;
19  import java.util.List;
20  
21  import org.seasar.framework.beans.PropertyDesc;
22  import org.seasar.uruma.component.UIComponent;
23  import org.seasar.uruma.desc.FormDesc;
24  
25  /**
26   * バインドの実行を行うためのインターフェースです。<br />
27   * ウィジットのクラス毎に対する実際のバインド処理は、設定された {@link ValueBinder} に委譲することで実現します。<br />
28   * 
29   * @author y-komori
30   */
31  public interface BindingCommand {
32  
33      /**
34       * <code>widget</code> と <code>formObj</code> の間でバインド処理を行います。<br />
35       * 
36       * @param widget
37       *            ウィジット側オブジェクト
38       * @param formObj
39       *            フォーム側オブジェクト
40       * @param propDesc
41       *            フォーム側のプロパティを表す {@link PropertyDesc} オブジェクト
42       * @param uiComp
43       *            コンポーネント
44       */
45      public void doBind(Object widget, Object formObj, PropertyDesc propDesc,
46              UIComponent uiComp);
47  
48      /**
49       * <code>field</code> に対応する id を取得します。<br />
50       * フィールドにアノテーションが設定されていれば、その id 属性を返し、アノテーションが設定されていなければ、フィールFO名称を id
51       * として返します。<br />
52       * 
53       * @param field
54       *            id を取得するフィールド
55       * @return id。
56       */
57      public String getId(Field field);
58  
59      /**
60       * {@link FormDesc} からバインド対象フィールドの {@link PropertyDesc} を取得します。<br />
61       * 
62       * @param desc
63       *            {@link FormDesc} オブジェクト
64       * @return バインド対象フィールドの {@link PropertyDesc} リスト
65       */
66      public List<PropertyDesc> getTargetPropertyDescs(FormDesc desc);
67  }