アノテーションを使用できないため、現時点ではSpring 2.0.8を使用しています(アップグレードのサインオフを待っています).xdocletを使用して、多数のBeanのBean構成ファイルを生成します未来。
ただし、ant ターゲットを実行すると、xml ファイルが作成されますが、Bean タグが含まれていません。
私のantスクリプトは次のようになります。
<taskdef name="springdoclet" classname="xdoclet.modules.spring.SpringDocletTask">
<classpath refid="springdoclet.classpath"/>
</taskdef>
<taskdef name="doclet" classname="xdoclet.DocletTask">
<classpath refid="springdoclet.classpath"/>
</taskdef>
<target name="generate-spring-wiring">
<springdoclet destdir="${resource.dir}" excludedtags="@version,@author,@todo">
<fileset dir="${global.src.dir}"/>
<springxml destinationfile="spring-wiring.xml"/>
</springdoclet>
</target>
結果の xml ファイルは次のようになります。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC
"-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans
default-autowire="no"
default-lazy-init="false"
default-dependency-check="none"
>
<!--
To include additional bean definitions for Spring in the generated
application context file, add a file to your XDoclet merge directory
called spring-beans.xml that contains the <bean></bean> markup.
-->
</beans>
ご覧のとおり、Bean は設定されていません。
私の Bean クラスはすべて、同じソース ディレクトリにある親クラスから継承します。MasterBean は次のように設定されています。
/**
*
*@spring.bean id="master"
*/
abstract public class Master implements Rule {
..
..
}
そして、サンプルの子クラス (同じパッケージ内に次のように設定されています。
/**
*
* @spring.bean id="G27"
*/
public class Global27_IncorrectFormTypeForCA extends Master {
これは、私のクラスがスーパークラスを拡張するという事実と関係がありますか? それとも単に設定が間違っているのでしょうか。これに関するドキュメントは事実上存在しないため、どんな助けも感謝して受け取ります.
ありがとう