父类
package SysCommon.util; import java.io.Serializable; import SysCommon.util.Tools; public abstract class IBean implements Serializable { public String toJson() throws Exception { return Tools.gson.toJson(this); } }
子类
package org.jgw.onepai.bean; import java.util.List; import android.graphics.Bitmap; import SysCommon.util.IBean; public class Article extends IBean { public String CURR_aid; public String CURR_acronym; public String CURR_article_name; public String CURR_specification; public String CURR_unit; public String CURR_supplier_id; public String CURR_segregate_id; public String CURR_brand_id; public String CURR_origin; public float CURR_last_entry_price; public int CURR_duty_paragraph; public String CURR_status; public float CURR_retail_price; public float CURR_member_price; public String CURR_img; public String CURR_memo; public List<Barcode> CURR_barcode ; transient public Bitmap img; public Brand CURR_brand; }
小结 对象序列化:
1、implements Serializable
2、某个变量不序列化 transient public Bitmap img