GenTemplate.java
1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/**
* Copyright © 2015-2018 ODM All rights reserved.
*/
package com.thinkgem.jeesite.modules.gen.entity;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.hibernate.validator.constraints.Length;
import com.google.common.collect.Lists;
import com.thinkgem.jeesite.common.persistence.DataEntity;
import com.thinkgem.jeesite.common.utils.StringUtils;
/**
* 生成方案Entity
* @author ThinkGem
* @version 2013-10-15
*/
@XmlRootElement(name="template")
public class GenTemplate extends DataEntity<GenTemplate> {
private static final long serialVersionUID = 1L;
private String name; // 名称
private String category; // 分类
private String filePath; // 生成文件路径
private String fileName; // 文件名
private String content; // 内容
public GenTemplate() {
super();
}
public GenTemplate(String id){
super(id);
}
@Length(min=1, max=200)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
@XmlTransient
public List<String> getCategoryList() {
if (category == null){
return Lists.newArrayList();
}else{
return Lists.newArrayList(StringUtils.split(category, ","));
}
}
public void setCategoryList(List<String> categoryList) {
if (categoryList == null){
this.category = "";
}else{
this.category = ","+StringUtils.join(categoryList, ",") + ",";
}
}
}