xml から Java オブジェクトへの解析を行っていますが、解析の時間は、billingDetailsとexpiryDetailsを取得しています *null* 私の xml は _ です
<?xml version="1.0" encoding="UTF-8" standalone="yes">
<item>
<id>7</id>
<category>NONE</category>
<name>ServiceCharge</name>
<description>Service Charge</description>
<unitKey>NONE</unitKey>
<billingDetails>
<billFrequency>NONE</billFrequency>
<billingCycle>NOT_DEFINED</billingCycle>
</billingDetails>
<expiryDetails>
<expiryDays>0</expiryDays>
<expiryMethod>EXPIRE_PERIOD</expiryMethod>
</expiryDetails>
<gracePeriod>0</gracePeriod>
</item>
m この Java コードを実行しています_
public static void digestItemsDetails(Digester digester, String root) {
String itemTag = root;
digester.addObjectCreate(itemTag, Item.class);
digester.addCallMethod(itemTag +"/id", "setId", 0);
digester.addCallMethod(itemTag +"/category", "setCategory", 0);
digester.addCallMethod(itemTag +"/name", "setName", 0);
digester.addCallMethod(itemTag +"/description", "setDescription", 0);
digester.addCallMethod(itemTag +"/unitKey", "setUnitKey", 0);
String billingPrefix = itemTag + "/billingDetails";
digester.addObjectCreate(billingPrefix, BillingDetails.class);
digester.addCallMethod(billingPrefix +"/billFrequency", "setBillFrequency", 0);
digester.addCallMethod(billingPrefix +"/billingCycle", "setBillingCycle", 0); 0);
String expiryPrefix = itemTag + "/expiryDetails";
digester.addObjectCreate(expiryPrefix, ExpiryDetails.class);
digester.addCallMethod(expiryPrefix +"/expiryDays", "setExpiryDays", 0);
digester.addCallMethod(expiryPrefix +"/expiryMethod", "setExpiryMethod", 0);
digester.addCallMethod(itemTag+"/gracePeriod", "setGracePeriod", 0);
}
Item.javaクラス
public class Item {
....
public BillingDetails getBillingDetails() {
return billingDetails;
}
public void setBillingDetails(BillingDetails billingDetails) {
this.billingDetails = billingDetails;
}
......
}
しかし、 billingDetailsとexpiryDetailsでNULL を取得しています。ありがとう