KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > project > overlay > BuildOverlay


1 package org.apache.maven.project.overlay;
2
3 /*
4  * Copyright 2001-2005 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import org.apache.maven.model.Build;
20 import org.apache.maven.model.Extension;
21 import org.apache.maven.model.Plugin;
22 import org.apache.maven.model.PluginManagement;
23 import org.apache.maven.model.Resource;
24
25 import java.util.ArrayList JavaDoc;
26 import java.util.List JavaDoc;
27 import java.util.Map JavaDoc;
28
29 /**
30  * @todo why delegate? this is asking for trouble when there are additions.
31  */

32 public class BuildOverlay
33     extends Build
34 {
35     
36     private final Build build;
37     
38     private List JavaDoc resources;
39     private List JavaDoc testResources;
40
41     public BuildOverlay( Build build )
42     {
43         if ( build == null )
44         {
45             this.build = new Build();
46             
47             this.resources = new ArrayList JavaDoc();
48             
49             this.testResources = new ArrayList JavaDoc();
50         }
51         else
52         {
53             this.build = build;
54             
55             this.resources = new ArrayList JavaDoc( build.getResources() );
56             
57             this.testResources = new ArrayList JavaDoc( build.getTestResources() );
58         }
59     }
60
61     public void addExtension( Extension extension )
62     {
63         build.addExtension( extension );
64     }
65
66     public void addPlugin( Plugin plugin )
67     {
68         build.addPlugin( plugin );
69     }
70
71     public void addResource( Resource resource )
72     {
73         resources.add( resource );
74     }
75
76     public void addTestResource( Resource resource )
77     {
78         testResources.add( resource );
79     }
80
81     public boolean equals( Object JavaDoc obj )
82     {
83         return build.equals( obj );
84     }
85
86     public void flushPluginMap()
87     {
88         build.flushPluginMap();
89     }
90
91     public String JavaDoc getDefaultGoal()
92     {
93         return build.getDefaultGoal();
94     }
95
96     public String JavaDoc getDirectory()
97     {
98         return build.getDirectory();
99     }
100
101     public List JavaDoc getExtensions()
102     {
103         return build.getExtensions();
104     }
105
106     public String JavaDoc getFinalName()
107     {
108         return build.getFinalName();
109     }
110
111     public String JavaDoc getOutputDirectory()
112     {
113         return build.getOutputDirectory();
114     }
115
116     public PluginManagement getPluginManagement()
117     {
118         return build.getPluginManagement();
119     }
120
121     public List JavaDoc getPlugins()
122     {
123         return build.getPlugins();
124     }
125
126     public Map JavaDoc getPluginsAsMap()
127     {
128         return build.getPluginsAsMap();
129     }
130
131     public List JavaDoc getResources()
132     {
133         return resources;
134     }
135
136     public String JavaDoc getScriptSourceDirectory()
137     {
138         return build.getScriptSourceDirectory();
139     }
140
141     public String JavaDoc getSourceDirectory()
142     {
143         return build.getSourceDirectory();
144     }
145
146     public String JavaDoc getTestOutputDirectory()
147     {
148         return build.getTestOutputDirectory();
149     }
150
151     public List JavaDoc getTestResources()
152     {
153         return testResources;
154     }
155
156     public String JavaDoc getTestSourceDirectory()
157     {
158         return build.getTestSourceDirectory();
159     }
160
161     public int hashCode()
162     {
163         return build.hashCode();
164     }
165
166     public void removeExtension( Extension extension )
167     {
168         build.removeExtension( extension );
169     }
170
171     public void removePlugin( Plugin plugin )
172     {
173         build.removePlugin( plugin );
174     }
175
176     public void removeResource( Resource resource )
177     {
178         resources.remove( resource );
179     }
180
181     public void removeTestResource( Resource resource )
182     {
183         testResources.remove( resource );
184     }
185
186     public void setDefaultGoal( String JavaDoc defaultGoal )
187     {
188         build.setDefaultGoal( defaultGoal );
189     }
190
191     public void setDirectory( String JavaDoc directory )
192     {
193         build.setDirectory( directory );
194     }
195
196     public void setExtensions( List JavaDoc extensions )
197     {
198         build.setExtensions( extensions );
199     }
200
201     public void setFinalName( String JavaDoc finalName )
202     {
203         build.setFinalName( finalName );
204     }
205
206     public void setOutputDirectory( String JavaDoc outputDirectory )
207     {
208         build.setOutputDirectory( outputDirectory );
209     }
210
211     public void setPluginManagement( PluginManagement pluginManagement )
212     {
213         build.setPluginManagement( pluginManagement );
214     }
215
216     public void setPlugins( List JavaDoc plugins )
217     {
218         build.setPlugins( plugins );
219     }
220
221     public void setResources( List JavaDoc resources )
222     {
223         this.resources = resources;
224     }
225
226     public void setScriptSourceDirectory( String JavaDoc scriptSourceDirectory )
227     {
228         build.setScriptSourceDirectory( scriptSourceDirectory );
229     }
230
231     public void setSourceDirectory( String JavaDoc sourceDirectory )
232     {
233         build.setSourceDirectory( sourceDirectory );
234     }
235
236     public void setTestOutputDirectory( String JavaDoc testOutputDirectory )
237     {
238         build.setTestOutputDirectory( testOutputDirectory );
239     }
240
241     public void setTestResources( List JavaDoc testResources )
242     {
243         this.testResources = testResources;
244     }
245
246     public void setTestSourceDirectory( String JavaDoc testSourceDirectory )
247     {
248         build.setTestSourceDirectory( testSourceDirectory );
249     }
250
251     public String JavaDoc toString()
252     {
253         return build.toString();
254     }
255
256     public void addFilter( String JavaDoc string )
257     {
258         build.addFilter( string );
259     } //-- void addFilter(String)
260

261     public List JavaDoc getFilters()
262     {
263         return build.getFilters();
264     } //-- java.util.List getFilters()
265

266     public void removeFilter( String JavaDoc string )
267     {
268         build.removeFilter( string );
269     } //-- void removeFilter(String)
270

271     public void setFilters( List JavaDoc filters )
272     {
273         build.setFilters( filters );
274     } //-- void setFilters(java.util.List)
275
}
276
Popular Tags