PageModel add id

This commit is contained in:
hmm 2014-08-21 13:20:21 +08:00
parent 87a16b3ee5
commit 41f7dd7b42
2 changed files with 26 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "page") @XmlRootElement(name = "page")
public class PageModel { public class PageModel {
private String id;
private List<BatchModel> batches; private List<BatchModel> batches;
@XmlElementWrapper(name = "batches") @XmlElementWrapper(name = "batches")
@ -21,7 +22,19 @@ public class PageModel {
this.batches = batches; this.batches = batches;
} }
public PageModel() { @XmlElement
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public PageModel(){
this.setBatches(new ArrayList<BatchModel>());
}
public PageModel(String id) {
this.id = id;
this.setBatches(new ArrayList<BatchModel>()); this.setBatches(new ArrayList<BatchModel>());
} }
} }

View File

@ -56,20 +56,29 @@ public class UsePluginModel {
public UsePluginModel() { public UsePluginModel() {
} }
public static UsePluginModel createUsePlugin(String id, String name, public static UsePluginModel createUsePlugin(String id, String name,String nickName,
List<ParameterModel> initParameters) { List<ParameterModel> initParameters) {
UsePluginModel result = new UsePluginModel(); UsePluginModel result = new UsePluginModel();
result.setId(id); result.setId(id);
result.setName(name); result.setName(name);
result.setNickName(id); result.setNickName(nickName);
result.setParameters(initParameters); result.setParameters(initParameters);
return result; return result;
} }
public UsePluginModel(String id, String name, public UsePluginModel(String id, String name,
List<ParameterModel> parameters) { List<ParameterModel> parameters) {
this.setId(id); this.setId(id);
this.setName(name); this.setName(name);
this.setNickName(name+"_"+id);
if (parameters == null) {
parameters = new LinkedList<ParameterModel>();
}
this.setParameters(parameters);
}
public UsePluginModel(String id, String name,String nickName,
List<ParameterModel> parameters) {
this.setId(id);
this.setName(name);
this.setNickName(id); this.setNickName(id);
if (parameters == null) { if (parameters == null) {
parameters = new LinkedList<ParameterModel>(); parameters = new LinkedList<ParameterModel>();