|
|||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||
java.lang.Objectorg.seasar.framework.container.factory.AbstractAnnotationHandler
org.seasar.framework.container.factory.ConstantAnnotationHandler
クラスに指定された定数アノテーションからコンポーネント定義を作成する実装クラスです。
定数アノテーションとはpublic,static,finalを用いて記述されたフィールドの事です。
フィールドのキーと値は次の形式で指定します。
key1=value1,key2=value2,key3=value3....指定出来るキーとその値はそれぞれの定数アノテーションで説明します。 一部の定数アノテーションのフィールドにはキーとその値を指定することが出来ないものもあります。 フィールドの値が不正な場合は
IllegalArgumentExceptionをスローします。
Componentアノテーション
Componentアノテーションは、フィールド名がCOMPONENTでString型のフィールドです。
Componentアノテーションであるフィールドに指定出来るキーは以下になります。
nameinstanceautoBindingexternalBinding指定されたキーとその値に従ってコンポーネント定義を作成します。
Bindingアノテーション
Bindingアノテーションは、フィールド名がプロパティ名_BINDINGでString型のフィールドです。
Bindingアノテーションであるフィールドに指定出来るキーは以下になります。
bindingTypevalueBindingアノテーションのフィールドにはnullやONGL式を直接指定することも出来ます。
指定されたキーとその値に従ってプロパティ定義を作成します。
AspectアノテーションAspectアノテーションは、フィールド名がASPECTでString型のフィールドです。
Aspectアノテーションであるフィールドに指定出来るキーは以下になります。
valuepointcut指定されたキーとその値に従ってアスペクト定義を作成します。
InterTypeアノテーション
InterTypeアノテーションは、フィールド名がINTER_TYPEでString型のフィールドです。
InterTypeアノテーションであるフィールドには、ONGL式を指定します。
指定されたONGL式を元にインタータイプ定義を作成し、コンポーネント定義に追加します。
InitMethodアノテーション
InitMethodアノテーションは、フィールド名がINIT_METHODでString型のフィールドです。
InitMethodアノテーションであるフィールドには、コンポーネントが初期化されるときに呼び出したいメソッド名を指定します。メソッドが複数ある時はカンマで区切ることが出来ます。
指定されたメソッド名から初期化メソッドを生成し、コンポーネント定義に追加します。
DestroyMethodアノテーション
DestroyMethodアノテーションは、フィールド名がDESTROY_METHODでString型のフィールドです。
DestroyMethodアノテーションであるフィールドには、コンポーネントが終了される時に呼び出したいメソッド名を指定します。メソッドが複数ある時はカンマで区切ることが出来ます。
指定されたメソッド名からdestroyメソッドを生成し、コンポーネント定義に追加します。
| フィールドの概要 |
| クラス org.seasar.framework.container.factory.AbstractAnnotationHandler から継承したフィールド |
ASPECT, AUTO_BINDING, BINDING_SUFFIX, BINDING_TYPE, COMPONENT, DESTROY_METHOD, EXTERNAL_BINDING, INIT_METHOD, INSTANCE, INTER_TYPE, INTERCEPTOR, NAME, POINTCUT, VALUE |
| コンストラクタの概要 | |
ConstantAnnotationHandler()
|
|
| メソッドの概要 | |
void |
appendAspect(ComponentDef componentDef)
コンポーネント定義にアスペクト定義を追加します。 |
protected void |
appendAspect(ComponentDef componentDef,
String interceptor,
Method targetMethod)
指定されたインターセプタ名とメソッドからアスペクト定義を生成し、コンポーネント定義に追加します。 |
protected void |
appendAspect(ComponentDef componentDef,
String interceptor,
String pointcut)
指定されたインターセプタ名とポイントカットを表す文字列からアスペクト定義を生成し、コンポーネント定義に追加します。 |
void |
appendDestroyMethod(ComponentDef componentDef)
コンポーネント定義にdestroyMethodを追加します。 |
protected void |
appendDestroyMethod(ComponentDef componentDef,
Method targetMethod)
指定されたメソッドからdestroyメソッド定義を生成し、コンポーネント定義に追加します。 |
protected void |
appendDestroyMethod(ComponentDef componentDef,
String methodName)
指定されたメソッド名からdestroyメソッド定義を生成し、コンポーネント定義に追加します。 |
void |
appendInitMethod(ComponentDef componentDef)
コンポーネント定義に初期化メソッドを追加します。 |
protected void |
appendInitMethod(ComponentDef componentDef,
Method method)
指定されたメソッドから初期化メソッド定義を生成し、コンポーネント定義に追加します。 |
protected void |
appendInitMethod(ComponentDef componentDef,
String methodName)
指定されたメソッド名から初期化メソッド定義を生成し、コンポーネント定義に追加します。 |
void |
appendInterType(ComponentDef componentDef)
コンポーネント定義にインタータイプ定義を追加します。 |
protected void |
appendInterType(ComponentDef componentDef,
String interTypeName)
インタータイプ定義を生成し、その定義にインタータイプ名で生成したOGNL式をセットしてコンポーネント定義に追加します。 |
ComponentDef |
createComponentDef(Class componentClass,
InstanceDef defaultInstanceDef,
AutoBindingDef defaultAutoBindingDef,
boolean defaultExternalBinding)
コンポーネントクラス、インスタンス定義、自動バインディング定義、外部バインディングを指定してコンポーネント定義を作成します。 |
PropertyDef |
createPropertyDef(BeanDesc beanDesc,
Field field)
フィールドを指定してコンポーネント定義に追加するプロパティ定義を作成します。 |
PropertyDef |
createPropertyDef(BeanDesc beanDesc,
PropertyDesc propertyDesc)
プロパティ名を指定してコンポーネント定義に追加するプロパティ定義を作成します。 |
protected boolean |
isConstantAnnotationField(Field field)
フィールドが定数アノテーションであるかどうかを判断します。 |
| クラス org.seasar.framework.container.factory.AbstractAnnotationHandler から継承したメソッド |
appendDI, createComponentDef, createComponentDef, createComponentDef, createComponentDef, createComponentDef, createComponentDef, createPropertyDef, getAutoBindingDef, getInstanceDef, getInstanceDef, isDestroyMethodRegisterable, isFieldInjectionTarget, isInitMethodRegisterable |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
public ConstantAnnotationHandler()
| メソッドの詳細 |
public ComponentDef createComponentDef(Class componentClass,
InstanceDef defaultInstanceDef,
AutoBindingDef defaultAutoBindingDef,
boolean defaultExternalBinding)
AnnotationHandler の記述:
componentClass - コンポーネントクラスdefaultInstanceDef - インスタンス定義defaultAutoBindingDef - 自動バインディング定義defaultExternalBinding - 外部バインディング
protected boolean isConstantAnnotationField(Field field)
field - フィールド
true,そうでない場合はfalse
public PropertyDef createPropertyDef(BeanDesc beanDesc,
PropertyDesc propertyDesc)
AnnotationHandler の記述:
beanDesc - プロパティに追加するBean名。propertyDesc - プロパティ名
public PropertyDef createPropertyDef(BeanDesc beanDesc,
Field field)
AnnotationHandler の記述:
beanDesc - プロパティに追加するBean名。field - フィールド名
public void appendAspect(ComponentDef componentDef)
AnnotationHandler の記述:
componentDef - コンポーネント定義
protected void appendAspect(ComponentDef componentDef,
String interceptor,
String pointcut)
nullの場合にはがスローされます。
componentDef - コンポーネント定義interceptor - インターセプタ名pointcut - ポイントカットを表す文字列
EmptyRuntimeException - インターセプタ名がnullの場合
protected void appendAspect(ComponentDef componentDef,
String interceptor,
Method targetMethod)
nullの場合にはがスローされます。
componentDef - コンポーネント定義interceptor - インターセプタ名targetMethod - メソッド
EmptyRuntimeException - インターセプタ名がnullの場合public void appendInterType(ComponentDef componentDef)
AnnotationHandler の記述:
componentDef - コンポーネント定義
protected void appendInterType(ComponentDef componentDef,
String interTypeName)
componentDef - コンポーネント定義interTypeName - インタータイプ名public void appendInitMethod(ComponentDef componentDef)
AnnotationHandler の記述:
componentDef - コンポーネント定義
protected void appendInitMethod(ComponentDef componentDef,
Method method)
componentDef - コンポーネント定義method - メソッド
protected void appendInitMethod(ComponentDef componentDef,
String methodName)
componentDef - コンポーネント定義methodName - メソッド名public void appendDestroyMethod(ComponentDef componentDef)
AnnotationHandler の記述:
componentDef - コンポーネント定義
protected void appendDestroyMethod(ComponentDef componentDef,
Method targetMethod)
componentDef - コンポーネント定義
protected void appendDestroyMethod(ComponentDef componentDef,
String methodName)
componentDef - コンポーネント定義methodName - メソッド名
|
|||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||