Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Castor(イントロスペクション)を使用してJavaオブジェクトを生成しました。マーシャリング中に、生成されたxmlで必須タグを空に設定してもエラーが発生しません。
何をすべきか ?
Castor(intr)によるxmlの検証
私は答えを得ました:1)XSD用に生成された記述子の下にあるすべてのファイルをコンパイルします2)キャスターで。プロパティは 1 つのプロパティに言及します org.exolab.castor.regexp=org.exolab.castor.util.SunRegExpEvaluator 3) Marshalling /unMarshalling コードで validate() を使用します
次に、デフォルトで、Castor は XML に検証チェックを配置します。マーシャリングナドアンマーシャリング中。