EclipseでSpring用の入力支援
Eclipseの設定の、java-Editor-Templatesで以下を追加します。
(いずれもコンテキストはjavadocです)
名前:spb 説明:spring用bean定義xDocletタグ パターン: @spring.bean name="${enclosing_type}" autowire="no" singleton="true" 名前:spp 説明:spring用prop定義xDocletタグ パターン: @spring.property name="${prop_name}" ref="${bean_name}" value="${string_value}" list="${comma_separated_list}" 名前:spt 説明:spring用トランザクション定義-REQUIRED(デフォルト) パターン: @@org.springframework.transaction.interceptor.DefaultTransactionAttribute(propagationBehaviorName="PROPAGATION_REQUIRED") 名前:sptn 説明:spring用トランザクション定義-REQUIRES_NEW パターン: @@org.springframework.transaction.interceptor.DefaultTransactionAttribute(propagationBehaviorName="PROPAGATION_REQUIRES_NEW") 名前:spts 説明:spring用トランザクション定義-SUPPORTS パターン: @@org.springframework.transaction.interceptor.DefaultTransactionAttribute(propagationBehaviorName="PROPAGATION_SUPPORTS")
これでjavadoc内でspと打ってCtrl+スペースを押すとこれらの一覧が出るので選択すれば入力できます。
@spring.propertyは、ref,value,listのどれかを残して使わないものは削除します。プロパティ指定がxDocletで対応できないクラスはxDocletタグを入れないでおいて、自動生成しないもの用の定義ファイルに自分で定義を書きます。