org.seasar.doma
注釈型 AnnotateWith


@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface AnnotateWith

Dao が注釈されたインタフェースの実装クラスのソースコードにアノテーションを付与することを示します。

このアノテーションは次の場合にのみ有効です。

例:
google-guice のアノテーションを付与するには次のように記述します。
 @Dao(config = ConfigAdapter.class)
 @AnnotateWith(annotations = {
         @Annotation(target = AnnotationTarget.CONSTRUCOTR, type = Inject.class),
         @Annotation(target = AnnotationTarget.CONSTRUCOTR_PARAMETER, type = Named.class, elements = "\"sales\"") })
 public interface EmployeeDao {
     ...
 }
 
実装クラスは次のようになります。
 public class EmployeeDaoImpl extends org.seasar.doma.jdbc.DomaAbstractDao implements example.EmployeeDao {
 
     @com.google.inject.Inject()
     public EmployeeDaoImpl(@com.google.inject.name.Named("sales") org.seasar.doma.jdbc.Config config) {
         super(new org.seasar.doma.jdbc.ConfigAdapter(config));
     }
     ...
 }
 

作成者:
taedium

必須要素の概要
 Annotation[] annotations
          アノテーション
 

要素の詳細

annotations

public abstract Annotation[] annotations
アノテーション



Copyright © 2009 The Seasar Foundation. All Rights Reserved.