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;
import javax.xml.bind.JAXBException;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
import org.bench4q.share.helper.MarshalHelper;
import com.sun.xml.internal.txw2.annotation.XmlElement;
@XmlRootElement
public class ParamInfoModel {
@ -13,14 +11,16 @@ public class ParamInfoModel {
private String name;
private String lable;
private String type;
private ParamTypeClassAndContnet paramTypeClassAndContnet;
// private ParamTypeClassAndContnet paramTypeClassAndContnet;
public ParamTypeModel createParamTypeModel() throws JAXBException {
ParamTypeModel paramTypeModel = (ParamTypeModel) MarshalHelper.unmarshal(
paramTypeClassAndContnet.getParamTypeClass(),
paramTypeClassAndContnet.getContent());
return paramTypeModel;
}
private ParamTypeModel paramTypeModel;
// public ParamTypeModel createParamTypeModel() throws JAXBException {
// ParamTypeModel paramTypeModel = (ParamTypeModel) MarshalHelper
// .unmarshal(paramTypeClassAndContnet.getParamTypeClass(),
// paramTypeClassAndContnet.getContent());
// return paramTypeModel;
// }
@XmlElement
public String getName() {
@ -40,15 +40,15 @@ public class ParamInfoModel {
this.lable = lable;
}
@XmlElement
public ParamTypeClassAndContnet getParamTypeClassAndContnet() {
return paramTypeClassAndContnet;
}
public void setParamTypeClassAndContnet(
ParamTypeClassAndContnet paramTypeClassAndContnet) {
this.paramTypeClassAndContnet = paramTypeClassAndContnet;
}
// @XmlElement
// public ParamTypeClassAndContnet getParamTypeClassAndContnet() {
// return paramTypeClassAndContnet;
// }
//
// public void setParamTypeClassAndContnet(
// ParamTypeClassAndContnet paramTypeClassAndContnet) {
// this.paramTypeClassAndContnet = paramTypeClassAndContnet;
// }
@XmlElement
public String getType() {
@ -59,4 +59,16 @@ public class ParamInfoModel {
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;
}
}