refactor paramInfoModel

This commit is contained in:
fanfuxiaoran 2014-04-21 14:16:01 +08:00
parent 6188d14105
commit 710f3eed56
1 changed files with 32 additions and 20 deletions

View File

@ -1,11 +1,9 @@
package org.bench4q.share.models.master.plugin; package org.bench4q.share.models.master.plugin;
import javax.xml.bind.JAXBException; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import org.bench4q.share.helper.MarshalHelper;
import com.sun.xml.internal.txw2.annotation.XmlElement;
@XmlRootElement @XmlRootElement
public class ParamInfoModel { public class ParamInfoModel {
@ -13,14 +11,16 @@ public class ParamInfoModel {
private String name; private String name;
private String lable; private String lable;
private String type; private String type;
private ParamTypeClassAndContnet paramTypeClassAndContnet; // private ParamTypeClassAndContnet paramTypeClassAndContnet;
public ParamTypeModel createParamTypeModel() throws JAXBException { private ParamTypeModel paramTypeModel;
ParamTypeModel paramTypeModel = (ParamTypeModel) MarshalHelper.unmarshal(
paramTypeClassAndContnet.getParamTypeClass(), // public ParamTypeModel createParamTypeModel() throws JAXBException {
paramTypeClassAndContnet.getContent()); // ParamTypeModel paramTypeModel = (ParamTypeModel) MarshalHelper
return paramTypeModel; // .unmarshal(paramTypeClassAndContnet.getParamTypeClass(),
} // paramTypeClassAndContnet.getContent());
// return paramTypeModel;
// }
@XmlElement @XmlElement
public String getName() { public String getName() {
@ -40,15 +40,15 @@ public class ParamInfoModel {
this.lable = lable; this.lable = lable;
} }
@XmlElement // @XmlElement
public ParamTypeClassAndContnet getParamTypeClassAndContnet() { // public ParamTypeClassAndContnet getParamTypeClassAndContnet() {
return paramTypeClassAndContnet; // return paramTypeClassAndContnet;
} // }
//
public void setParamTypeClassAndContnet( // public void setParamTypeClassAndContnet(
ParamTypeClassAndContnet paramTypeClassAndContnet) { // ParamTypeClassAndContnet paramTypeClassAndContnet) {
this.paramTypeClassAndContnet = paramTypeClassAndContnet; // this.paramTypeClassAndContnet = paramTypeClassAndContnet;
} // }
@XmlElement @XmlElement
public String getType() { public String getType() {
@ -59,4 +59,16 @@ public class ParamInfoModel {
this.type = type; this.type = type;
} }
@XmlElements({ @XmlElement(name = "field", type = FieldModel.class),
@XmlElement(name = "table", type = TableModel.class),
@XmlElement(name = "checkbox", type = CheckBoxModel.class),
@XmlElement(name = "nfield", type = NFieldModel.class) })
public ParamTypeModel getParamTypeModel() {
return paramTypeModel;
}
public void setParamTypeModel(ParamTypeModel paramTypeModel) {
this.paramTypeModel = paramTypeModel;
}
} }