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