1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.archetype.old.descriptor;
20
21 import java.util.ArrayList;
22 import java.util.HashMap;
23 import java.util.List;
24 import java.util.Map;
25
26 public class ArchetypeDescriptor {
27 private String id;
28
29 private List<String> sources;
30
31 private List<String> testSources;
32
33 private List<String> resources;
34
35 private List<String> testResources;
36
37 private List<String> siteResources;
38
39
40
41
42
43
44 private Map<String, TemplateDescriptor> sourcesDescriptors;
45
46
47
48
49
50
51 private Map<String, TemplateDescriptor> testSourcesDescriptors;
52
53
54
55
56
57
58 private Map<String, TemplateDescriptor> resourcesDescriptors;
59
60
61
62
63
64
65 private Map<String, TemplateDescriptor> testResourcesDescriptors;
66
67
68
69
70
71
72 private Map<String, TemplateDescriptor> siteResourcesDescriptors;
73
74
75
76
77
78
79
80 private boolean allowPartial;
81
82 public ArchetypeDescriptor() {
83 sources = new ArrayList<>();
84
85 resources = new ArrayList<>();
86
87 testSources = new ArrayList<>();
88
89 testResources = new ArrayList<>();
90
91 siteResources = new ArrayList<>();
92
93 sourcesDescriptors = new HashMap<>();
94
95 testSourcesDescriptors = new HashMap<>();
96
97 resourcesDescriptors = new HashMap<>();
98
99 testResourcesDescriptors = new HashMap<>();
100
101 siteResourcesDescriptors = new HashMap<>();
102 }
103
104
105
106
107
108 public String getId() {
109 return id;
110 }
111
112 public void setId(String id) {
113 this.id = id;
114 }
115
116 public void addSource(String source) {
117 sources.add(source);
118
119 putSourceDescriptor(source, new TemplateDescriptor());
120 }
121
122 public List<String> getSources() {
123 return sources;
124 }
125
126 public void putSourceDescriptor(String source, TemplateDescriptor descriptor) {
127 sourcesDescriptors.put(source, descriptor);
128 }
129
130 public TemplateDescriptor getSourceDescriptor(String source) {
131 return sourcesDescriptors.get(source);
132 }
133
134 public Map<String, TemplateDescriptor> getSourcesDescriptors() {
135 return sourcesDescriptors;
136 }
137
138 public void addTestSource(String testSource) {
139 testSources.add(testSource);
140
141 putTestSourceDescriptor(testSource, new TemplateDescriptor());
142 }
143
144 public List<String> getTestSources() {
145 return testSources;
146 }
147
148 public void putTestSourceDescriptor(String testSource, TemplateDescriptor descriptor) {
149 testSourcesDescriptors.put(testSource, descriptor);
150 }
151
152 public TemplateDescriptor getTestSourceDescriptor(String testSource) {
153 return testSourcesDescriptors.get(testSource);
154 }
155
156 public Map<String, TemplateDescriptor> getTestSourcesDescriptors() {
157 return testSourcesDescriptors;
158 }
159
160 public void addResource(String resource) {
161 resources.add(resource);
162
163 putResourceDescriptor(resource, new TemplateDescriptor());
164 }
165
166 public List<String> getResources() {
167 return resources;
168 }
169
170 public void putResourceDescriptor(String resource, TemplateDescriptor descriptor) {
171 resourcesDescriptors.put(resource, descriptor);
172 }
173
174 public TemplateDescriptor getResourceDescriptor(String resource) {
175 return resourcesDescriptors.get(resource);
176 }
177
178 public Map<String, TemplateDescriptor> getReourcesDescriptors() {
179 return resourcesDescriptors;
180 }
181
182 public void addTestResource(String testResource) {
183 testResources.add(testResource);
184 putTestResourceDescriptor(testResource, new TemplateDescriptor());
185 }
186
187 public List<String> getTestResources() {
188 return testResources;
189 }
190
191 public void putTestResourceDescriptor(String testResource, TemplateDescriptor descriptor) {
192 testResourcesDescriptors.put(testResource, descriptor);
193 }
194
195 public TemplateDescriptor getTestResourceDescriptor(String testResource) {
196 return testResourcesDescriptors.get(testResource);
197 }
198
199 public Map<String, TemplateDescriptor> getTestReourcesDescriptors() {
200 return testResourcesDescriptors;
201 }
202
203 public void addSiteResource(String siteResource) {
204 siteResources.add(siteResource);
205
206 putSiteResourceDescriptor(siteResource, new TemplateDescriptor());
207 }
208
209 public List<String> getSiteResources() {
210 return siteResources;
211 }
212
213 public void putSiteResourceDescriptor(String siteResource, TemplateDescriptor descriptor) {
214 siteResourcesDescriptors.put(siteResource, descriptor);
215 }
216
217 public TemplateDescriptor getSiteResourceDescriptor(String siteResource) {
218 return siteResourcesDescriptors.get(siteResource);
219 }
220
221 public Map<String, TemplateDescriptor> getSiteReourcesDescriptors() {
222 return siteResourcesDescriptors;
223 }
224
225 public boolean isAllowPartial() {
226 return allowPartial;
227 }
228
229 public void setAllowPartial(boolean allowPartial) {
230 this.allowPartial = allowPartial;
231 }
232 }