1
2
3
4
5 package com.javaforge.bobber.archetype.model;
6
7
8
9
10
11 import java.util.Date;
12
13
14
15
16
17
18 public class BobberArchetype implements java.io.Serializable {
19
20
21
22
23
24
25
26
27
28 private String id;
29
30
31
32
33 private boolean allowPartial = false;
34
35
36
37
38 private java.util.List variables;
39
40
41
42
43 private java.util.List templates;
44
45
46
47
48
49
50
51
52
53
54
55 public void addTemplate(Template template)
56 {
57 if ( !(template instanceof Template) )
58 {
59 throw new ClassCastException( "BobberArchetype.addTemplates(template) parameter must be instanceof " + Template.class.getName() );
60 }
61 getTemplates().add( template );
62 }
63
64
65
66
67
68
69 public void addVariable(Variable variable)
70 {
71 if ( !(variable instanceof Variable) )
72 {
73 throw new ClassCastException( "BobberArchetype.addVariables(variable) parameter must be instanceof " + Variable.class.getName() );
74 }
75 getVariables().add( variable );
76 }
77
78
79
80
81
82
83 public String getId()
84 {
85 return this.id;
86 }
87
88
89
90
91
92
93 public java.util.List getTemplates()
94 {
95 if ( this.templates == null )
96 {
97 this.templates = new java.util.ArrayList();
98 }
99
100 return this.templates;
101 }
102
103
104
105
106
107
108 public java.util.List getVariables()
109 {
110 if ( this.variables == null )
111 {
112 this.variables = new java.util.ArrayList();
113 }
114
115 return this.variables;
116 }
117
118
119
120
121
122
123 public boolean isAllowPartial()
124 {
125 return this.allowPartial;
126 }
127
128
129
130
131
132
133 public void removeTemplate(Template template)
134 {
135 if ( !(template instanceof Template) )
136 {
137 throw new ClassCastException( "BobberArchetype.removeTemplates(template) parameter must be instanceof " + Template.class.getName() );
138 }
139 getTemplates().remove( template );
140 }
141
142
143
144
145
146
147 public void removeVariable(Variable variable)
148 {
149 if ( !(variable instanceof Variable) )
150 {
151 throw new ClassCastException( "BobberArchetype.removeVariables(variable) parameter must be instanceof " + Variable.class.getName() );
152 }
153 getVariables().remove( variable );
154 }
155
156
157
158
159
160
161 public void setAllowPartial(boolean allowPartial)
162 {
163 this.allowPartial = allowPartial;
164 }
165
166
167
168
169
170
171 public void setId(String id)
172 {
173 this.id = id;
174 }
175
176
177
178
179
180
181
182
183
184 public void setTemplates(java.util.List templates)
185 {
186 this.templates = templates;
187 }
188
189
190
191
192
193
194
195
196
197
198 public void setVariables(java.util.List variables)
199 {
200 this.variables = variables;
201 }
202
203
204 private String modelEncoding = "UTF-8";
205
206
207
208
209
210
211 public void setModelEncoding( String modelEncoding )
212 {
213 this.modelEncoding = modelEncoding;
214 }
215
216
217
218
219 public String getModelEncoding()
220 {
221 return modelEncoding;
222 }
223 }