https://img2020.cnblogs.com/blog/1101843/202010/1101843-20201029092119794-1182278230.jpg

支付宝

https://img2020.cnblogs.com/blog/1101843/202010/1101843-20201029091740174-1560674849.png

微 信

java RMI转换XML

 

import org.dom4j.Element;
import java.io.Serializable;
public class SelectionBody extends Body {

    /** serialVersionUID */
    private static final long serialVersionUID = -6826872985549264823L;

    /** CODE */
    private String code;
    /** 类型 */
    private String type;
    /** 等级 */
    private String level;

    /*
     * 将XML文档对象转换成业务对象
     */
    @Override
    public void fromXml(Element element) {
        if (element != null) {
            Element condition = element.element("Condition");
            if (condition != null) {
                code = condition.attributeValue("Code");
                type = condition.attributeValue("Type");
            }
        }
        super.fromXml(element);
    }

    /*
     * 将业务对象转换成XML文档对象
     */
    @Override
    public Element toXml(Element element) {
        if (element != null) {
            Element condition = element.addElement("Conditon");
            condition.addAttribute("Code", code != null ? code : "");
            condition.addAttribute("Type", type != null ? type : "");
        }
        return super.toXml(element);
    }
}

 

 

 

-----------------------------------------------------------------------------

 


 

 

 

posted @ 2019-07-25 10:44  huangwanlin  阅读(2090)  评论(0编辑  收藏  举报
Copyright 2012-2021 林云希科技有限责任公司