安怡的相公

前面有光

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
栗子:
 
 
binding.xml
 
<?xml version="1.0" encoding="UTF-8"?>
<binding>
       <mapping name="Transaction" class="com.robgao.test.jibx.test.bean.Transaction">
              <value name="RetailStoreID" field="retailStoreID" />
              <structure name="BusinessUnit" field="businessUnit">
                     <structure name="UnitID" field="unitID">
                           <value name="TypeCode" style="attribute" field="typeCode" />
                           <value style="text" field="unitid"></value>
                     </structure>
              </structure>
              
                     <structure usage="optional"
                           get-method="getIgnored" set-method="setIgnored"
                           marshaller="org.jibx.extras.DiscardElementMapper" unmarshaller="org.jibx.extras.DiscardElementMapper" />
              
       </mapping>
</binding>
 
JAVA Bean:
 
 
package com.robgao.test.jibx.test.bean;
public class Transaction {
       private int retailStoreID;
       private BusinessUnit businessUnit;
       public int getRetailStoreID() {
              return retailStoreID;
       }
       public void setRetailStoreID(int retailStoreID) {
              this.retailStoreID = retailStoreID;
       }
       public BusinessUnit getBusinessUnit() {
              return businessUnit;
       }
       public void setBusinessUnit(BusinessUnit businessUnit) {
              this.businessUnit = businessUnit;
       }
       private void setIgnored(Object ignore) {
       }
       private Object getIgnored() {
              return null;
       }
}
posted on 2017-02-14 02:45  包子先森  阅读(304)  评论(0编辑  收藏  举报