package weaver.interfaces.htsc.job.biz;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
import javax.xml.bind.annotation.*;
import java.io.StringWriter;

/**
 * Created by K1810006 on 2020/11/24.
 */
@XmlRootElement(name = "expression")
@XmlAccessorType(XmlAccessType.FIELD)
public class Expression {

    @XmlAttribute
    private String id = "-1";

    @XmlAttribute
    private String paramtype="-1";

    @XmlAttribute
    private String datafield;

    @XmlAttribute
    private String datafieldlabel;

    @XmlAttribute
    private String typehrm;

    @XmlAttribute
    private String htmltype;

    @XmlAttribute
    private String fieldtype;

    @XmlAttribute
    private String dbtype;

    @XmlAttribute
    private String compareoption1;

    @XmlAttribute
    private String compareoption2="-1";

    @XmlAttribute
    private String browservalue;

    @XmlAttribute
    private String browserspantext;

    @XmlAttribute
    private String browserspanlabel;

    @XmlAttribute
    private String browservalue2="";

    @XmlAttribute
    private String browserspantext2="";

    @XmlAttribute
    private String browserspanlabel2="";

    @XmlAttribute
    private String textvalue1;

    @XmlAttribute
    private String textvalue2="";

    @XmlAttribute
    private String valuetype;

    @XmlAttribute
    private String valuetype2="1";

    @XmlAttribute
    private String checkboxvalue1;

    @XmlAttribute
    private String redius="-1";

    @XmlAttribute
    private String nodeId="";

    @XmlAttribute
    private String selectvalue1;

    @XmlAttribute
    private String meetCondition="-1";

    @XmlAttribute
    private String jingdu="";

    @XmlAttribute
    private String weidu="";

    @XmlAttribute
    private String hrmConditon = "";

    @XmlAttribute
    private String hrmConditonValue="";

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParamtype() {
        return paramtype;
    }

    public void setParamtype(String paramtype) {
        this.paramtype = paramtype;
    }

    public String getDatafield() {
        return datafield;
    }

    public void setDatafield(String datafield) {
        this.datafield = datafield;
    }

    public String getDatafieldlabel() {
        return datafieldlabel;
    }

    public void setDatafieldlabel(String datafieldlabel) {
        this.datafieldlabel = datafieldlabel;
    }

    public String getTypehrm() {
        return typehrm;
    }

    public void setTypehrm(String typehrm) {
        this.typehrm = typehrm;
    }

    public String getHtmltype() {
        return htmltype;
    }

    public void setHtmltype(String htmltype) {
        this.htmltype = htmltype;
    }

    public String getFieldtype() {
        return fieldtype;
    }

    public void setFieldtype(String fieldtype) {
        this.fieldtype = fieldtype;
    }

    public String getDbtype() {
        return dbtype;
    }

    public void setDbtype(String dbtype) {
        this.dbtype = dbtype;
    }

    public String getCompareoption1() {
        return compareoption1;
    }

    public void setCompareoption1(String compareoption1) {
        this.compareoption1 = compareoption1;
    }

    public String getCompareoption2() {
        return compareoption2;
    }

    public void setCompareoption2(String compareoption2) {
        this.compareoption2 = compareoption2;
    }

    public String getBrowservalue() {
        return browservalue;
    }

    public void setBrowservalue(String browservalue) {
        this.browservalue = browservalue;
    }

    public String getBrowserspantext() {
        return browserspantext;
    }

    public void setBrowserspantext(String browserspantext) {
        this.browserspantext = browserspantext;
    }

    public String getBrowserspanlabel() {
        return browserspanlabel;
    }

    public void setBrowserspanlabel(String browserspanlabel) {
        this.browserspanlabel = browserspanlabel;
    }

    public String getBrowservalue2() {
        return browservalue2;
    }

    public void setBrowservalue2(String browservalue2) {
        this.browservalue2 = browservalue2;
    }

    public String getBrowserspantext2() {
        return browserspantext2;
    }

    public void setBrowserspantext2(String browserspantext2) {
        this.browserspantext2 = browserspantext2;
    }

    public String getBrowserspanlabel2() {
        return browserspanlabel2;
    }

    public void setBrowserspanlabel2(String browserspanlabel2) {
        this.browserspanlabel2 = browserspanlabel2;
    }

    public String getTextvalue1() {
        return textvalue1;
    }

    public void setTextvalue1(String textvalue1) {
        this.textvalue1 = textvalue1;
    }

    public String getTextvalue2() {
        return textvalue2;
    }

    public void setTextvalue2(String textvalue2) {
        this.textvalue2 = textvalue2;
    }

    public String getValuetype() {
        return valuetype;
    }

    public void setValuetype(String valuetype) {
        this.valuetype = valuetype;
    }

    public String getValuetype2() {
        return valuetype2;
    }

    public void setValuetype2(String valuetype2) {
        this.valuetype2 = valuetype2;
    }

    public String getCheckboxvalue1() {
        return checkboxvalue1;
    }

    public void setCheckboxvalue1(String checkboxvalue1) {
        this.checkboxvalue1 = checkboxvalue1;
    }

    public String getRedius() {
        return redius;
    }

    public void setRedius(String redius) {
        this.redius = redius;
    }

    public String getNodeId() {
        return nodeId;
    }

    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }

    public String getSelectvalue1() {
        return selectvalue1;
    }

    public void setSelectvalue1(String selectvalue1) {
        this.selectvalue1 = selectvalue1;
    }

    public String getMeetCondition() {
        return meetCondition;
    }

    public void setMeetCondition(String meetCondition) {
        this.meetCondition = meetCondition;
    }

    public String getJingdu() {
        return jingdu;
    }

    public void setJingdu(String jingdu) {
        this.jingdu = jingdu;
    }

    public String getWeidu() {
        return weidu;
    }

    public void setWeidu(String weidu) {
        this.weidu = weidu;
    }

    public String getHrmConditon() {
        return hrmConditon;
    }

    public void setHrmConditon(String hrmConditon) {
        this.hrmConditon = hrmConditon;
    }

    public String getHrmConditonValue() {
        return hrmConditonValue;
    }

    public void setHrmConditonValue(String hrmConditonValue) {
        this.hrmConditonValue = hrmConditonValue;
    }


    public static void main(String[] args) {
        try{
            Expression exp = new Expression();
            StringWriter sw = new StringWriter();
            //根据Person类生成上下文对象
            JAXBContext jc = JAXBContext.newInstance(Expression.class);
            //从上下文中获取Marshaller对象，用作将bean编组(转换)为xml
            Marshaller ma = jc.createMarshaller();
            //以下是为生成xml做的一些配置
            //格式化输出，即按标签自动换行，否则就是一行输出
            ma.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
            //设置编码（默认编码就是utf-8）
            ma.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
            //是否省略xml头信息，默认不省略（false）
            ma.setProperty(Marshaller.JAXB_FRAGMENT, false);

            //编组
            ma.marshal(exp, sw);
            System.out.println(sw.toString());

        }catch (Exception e){


        }

    }
}
