/* * Copyright 2004-2006 the Seasar Foundation and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.seasar.framework.container; /** * フィールドまたはプロパティへのアクセス方法の定義です。アクセス方法に基づいて、コンポーネントのフィールドまたはプロパティにコンテナ上のオブジェクトを割り当てる機能も提供します。 *

* アクセスタイプとは、フィールド(インスタンス変数/クラス変数)へのアクセス方法です。アクセスタイプには「フィールド」アクセスタイプと「プロパティ」アクセスタイプの2種類があります。 * 「フィールド」アクセスタイプは、フィールドへの直接アクセスを表します。「プロパティ」アクセスタイプは、Beanのプロパティ(getter/setter)によるアクセスを表します。 *

*

* このインターフェースを実装したインスタンスは、ファクトリ(AccessTypeDefFactoryなど)経由で取得します。 *

*

* AccessTypeDefは、{@link PropertyDef}の属性です。 *

* * @author koichik * @author belltree (Javadoc) */ public interface AccessTypeDef { /** * 「フィールド」アクセスタイプを表す定数です。 */ String FIELD_NAME = "field"; /** * 「プロパティ」アクセスタイプを表す定数です。 */ String PROPERTY_NAME = "property"; /** * アクセスタイプ名を返します。 *

* アクセスタイプ名は、アクセスタイプを表す文字列リテラルです。 *

* * @return アクセスタイプ名 * * @see #PROPERTY_NAME * @see #FIELD_NAME */ String getName(); /** * アクセスタイプに基づいて、コンポーネントのフィールドまたはプロパティにコンテナ上のオブジェクトを割り当てます。 * * @param componentDef * コンポーネント定義 * @param propertyDef * プロパティ定義 * @param component * コンポーネント */ void bind(ComponentDef componentDef, PropertyDef propertyDef, Object component); /** * アクセスタイプに基づいて、コンポーネントのフィールドまたはプロパティにコンテナ上のオブジェクトを割り当てます。 * * @param componentDef * コンポーネント定義 * @param propertyDef * プロパティ定義 * @param bindingTypeDef * バインディングタイプ定義 * @param component * コンポーネント */ void bind(ComponentDef componentDef, PropertyDef propertyDef, BindingTypeDef bindingTypeDef, Object component); }