View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.11,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.model;
7   
8   /**
9    * This elements describes all that pertains to distribution for a
10   * project. It is
11   *         primarily used for deployment of artifacts and the site
12   * produced by the build.
13   * 
14   * @version $Revision$ $Date$
15   */
16  @SuppressWarnings( "all" )
17  public class DistributionManagement
18      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
19  {
20  
21        //--------------------------/
22       //- Class/Member Variables -/
23      //--------------------------/
24  
25      /**
26       * Information needed to deploy the artifacts generated by the
27       * project to a
28       *             remote repository.
29       */
30      private DeploymentRepository repository;
31  
32      /**
33       * 
34       *             
35       *             Where to deploy snapshots of artifacts to. If
36       * not given, it defaults to the
37       *             <code>repository</code> element.
38       *             
39       *           
40       */
41      private DeploymentRepository snapshotRepository;
42  
43      /**
44       * Information needed for deploying the web site of the project.
45       */
46      private Site site;
47  
48      /**
49       * 
50       *             
51       *             The URL of the project's download page. If not
52       * given users will be
53       *             referred to the homepage given by
54       * <code>url</code>.
55       *             This is given to assist in locating artifacts
56       * that are not in the repository due to
57       *             licensing restrictions.
58       *             
59       *           
60       */
61      private String downloadUrl;
62  
63      /**
64       * Relocation information of the artifact if it has been moved
65       * to a new group ID
66       *             and/or artifact ID.
67       */
68      private Relocation relocation;
69  
70      /**
71       * 
72       *             
73       *             Gives the status of this artifact in the remote
74       * repository.
75       *             This must not be set in your local project, as
76       * it is updated by
77       *             tools placing it in the reposiory. Valid values
78       * are: <code>none</code> (default),
79       *             <code>converted</code> (repository manager
80       * converted this from an Maven 1 POM),
81       *             <code>partner</code>
82       *             (directly synced from a partner Maven 2
83       * repository), <code>deployed</code> (was deployed from a
84       * Maven 2
85       *             instance), <code>verified</code> (has been hand
86       * verified as correct and final).
87       *             
88       *           
89       */
90      private String status;
91  
92      /**
93       * Field locations.
94       */
95      private java.util.Map<Object, InputLocation> locations;
96  
97      /**
98       * Field location.
99       */
100     private InputLocation location;
101 
102     /**
103      * Field repositoryLocation.
104      */
105     private InputLocation repositoryLocation;
106 
107     /**
108      * Field snapshotRepositoryLocation.
109      */
110     private InputLocation snapshotRepositoryLocation;
111 
112     /**
113      * Field siteLocation.
114      */
115     private InputLocation siteLocation;
116 
117     /**
118      * Field downloadUrlLocation.
119      */
120     private InputLocation downloadUrlLocation;
121 
122     /**
123      * Field relocationLocation.
124      */
125     private InputLocation relocationLocation;
126 
127     /**
128      * Field statusLocation.
129      */
130     private InputLocation statusLocation;
131 
132 
133       //-----------/
134      //- Methods -/
135     //-----------/
136 
137     /**
138      * Method clone.
139      * 
140      * @return DistributionManagement
141      */
142     public DistributionManagement clone()
143     {
144         try
145         {
146             DistributionManagement copy = (DistributionManagement) super.clone();
147 
148             if ( this.repository != null )
149             {
150                 copy.repository = (DeploymentRepository) this.repository.clone();
151             }
152 
153             if ( this.snapshotRepository != null )
154             {
155                 copy.snapshotRepository = (DeploymentRepository) this.snapshotRepository.clone();
156             }
157 
158             if ( this.site != null )
159             {
160                 copy.site = (Site) this.site.clone();
161             }
162 
163             if ( this.relocation != null )
164             {
165                 copy.relocation = (Relocation) this.relocation.clone();
166             }
167 
168             if ( copy.locations != null )
169             {
170                 copy.locations = new java.util.LinkedHashMap( copy.locations );
171             }
172 
173             return copy;
174         }
175         catch ( java.lang.Exception ex )
176         {
177             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
178                 + " does not support clone()" ).initCause( ex );
179         }
180     } //-- DistributionManagement clone()
181 
182     /**
183      * Get the URL of the project's download page. If not given
184      * users will be
185      *             referred to the homepage given by
186      * <code>url</code>.
187      *             This is given to assist in locating artifacts
188      * that are not in the repository due to
189      *             licensing restrictions.
190      * 
191      * @return String
192      */
193     public String getDownloadUrl()
194     {
195         return this.downloadUrl;
196     } //-- String getDownloadUrl()
197 
198     /**
199      * 
200      * 
201      * @param key
202      * @return InputLocation
203      */
204     public InputLocation getLocation( Object key )
205     {
206         if ( key instanceof String )
207         {
208             switch ( ( String ) key )
209             {
210                 case "" :
211                 {
212                     return this.location;
213                 }
214                 case "repository" :
215                 {
216                     return repositoryLocation;
217                 }
218                 case "snapshotRepository" :
219                 {
220                     return snapshotRepositoryLocation;
221                 }
222                 case "site" :
223                 {
224                     return siteLocation;
225                 }
226                 case "downloadUrl" :
227                 {
228                     return downloadUrlLocation;
229                 }
230                 case "relocation" :
231                 {
232                     return relocationLocation;
233                 }
234                 case "status" :
235                 {
236                     return statusLocation;
237                 }
238                 default :
239                 {
240                     return getOtherLocation( key );
241                 }
242                 }
243             }
244             else
245             {
246                 return getOtherLocation( key );
247             }
248     } //-- InputLocation getLocation( Object )
249 
250     /**
251      * 
252      * 
253      * @param key
254      * @param location
255      */
256     public void setLocation( Object key, InputLocation location )
257     {
258         if ( key instanceof String )
259         {
260             switch ( ( String ) key )
261             {
262                 case "" :
263                 {
264                     this.location = location;
265                     return;
266                 }
267                 case "repository" :
268                 {
269                     repositoryLocation = location;
270                     return;
271                 }
272                 case "snapshotRepository" :
273                 {
274                     snapshotRepositoryLocation = location;
275                     return;
276                 }
277                 case "site" :
278                 {
279                     siteLocation = location;
280                     return;
281                 }
282                 case "downloadUrl" :
283                 {
284                     downloadUrlLocation = location;
285                     return;
286                 }
287                 case "relocation" :
288                 {
289                     relocationLocation = location;
290                     return;
291                 }
292                 case "status" :
293                 {
294                     statusLocation = location;
295                     return;
296                 }
297                 default :
298                 {
299                     setOtherLocation( key, location );
300                     return;
301                 }
302                 }
303             }
304             else
305             {
306                 setOtherLocation( key, location );
307             }
308     } //-- void setLocation( Object, InputLocation )
309 
310     /**
311      * 
312      * 
313      * @param key
314      * @param location
315      */
316     public void setOtherLocation( Object key, InputLocation location )
317     {
318         if ( location != null )
319         {
320             if ( this.locations == null )
321             {
322                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
323             }
324             this.locations.put( key, location );
325         }
326     } //-- void setOtherLocation( Object, InputLocation )
327 
328     /**
329      * 
330      * 
331      * @param key
332      * @return InputLocation
333      */
334     private InputLocation getOtherLocation( Object key )
335     {
336         return ( locations != null ) ? locations.get( key ) : null;
337     } //-- InputLocation getOtherLocation( Object )
338 
339     /**
340      * Get relocation information of the artifact if it has been
341      * moved to a new group ID
342      *             and/or artifact ID.
343      * 
344      * @return Relocation
345      */
346     public Relocation getRelocation()
347     {
348         return this.relocation;
349     } //-- Relocation getRelocation()
350 
351     /**
352      * Get information needed to deploy the artifacts generated by
353      * the project to a
354      *             remote repository.
355      * 
356      * @return DeploymentRepository
357      */
358     public DeploymentRepository getRepository()
359     {
360         return this.repository;
361     } //-- DeploymentRepository getRepository()
362 
363     /**
364      * Get information needed for deploying the web site of the
365      * project.
366      * 
367      * @return Site
368      */
369     public Site getSite()
370     {
371         return this.site;
372     } //-- Site getSite()
373 
374     /**
375      * Get where to deploy snapshots of artifacts to. If not given,
376      * it defaults to the
377      *             <code>repository</code> element.
378      * 
379      * @return DeploymentRepository
380      */
381     public DeploymentRepository getSnapshotRepository()
382     {
383         return this.snapshotRepository;
384     } //-- DeploymentRepository getSnapshotRepository()
385 
386     /**
387      * Get gives the status of this artifact in the remote
388      * repository.
389      *             This must not be set in your local project, as
390      * it is updated by
391      *             tools placing it in the reposiory. Valid values
392      * are: <code>none</code> (default),
393      *             <code>converted</code> (repository manager
394      * converted this from an Maven 1 POM),
395      *             <code>partner</code>
396      *             (directly synced from a partner Maven 2
397      * repository), <code>deployed</code> (was deployed from a
398      * Maven 2
399      *             instance), <code>verified</code> (has been hand
400      * verified as correct and final).
401      * 
402      * @return String
403      */
404     public String getStatus()
405     {
406         return this.status;
407     } //-- String getStatus()
408 
409     /**
410      * Set the URL of the project's download page. If not given
411      * users will be
412      *             referred to the homepage given by
413      * <code>url</code>.
414      *             This is given to assist in locating artifacts
415      * that are not in the repository due to
416      *             licensing restrictions.
417      * 
418      * @param downloadUrl
419      */
420     public void setDownloadUrl( String downloadUrl )
421     {
422         this.downloadUrl = downloadUrl;
423     } //-- void setDownloadUrl( String )
424 
425     /**
426      * Set relocation information of the artifact if it has been
427      * moved to a new group ID
428      *             and/or artifact ID.
429      * 
430      * @param relocation
431      */
432     public void setRelocation( Relocation relocation )
433     {
434         this.relocation = relocation;
435     } //-- void setRelocation( Relocation )
436 
437     /**
438      * Set information needed to deploy the artifacts generated by
439      * the project to a
440      *             remote repository.
441      * 
442      * @param repository
443      */
444     public void setRepository( DeploymentRepository repository )
445     {
446         this.repository = repository;
447     } //-- void setRepository( DeploymentRepository )
448 
449     /**
450      * Set information needed for deploying the web site of the
451      * project.
452      * 
453      * @param site
454      */
455     public void setSite( Site site )
456     {
457         this.site = site;
458     } //-- void setSite( Site )
459 
460     /**
461      * Set where to deploy snapshots of artifacts to. If not given,
462      * it defaults to the
463      *             <code>repository</code> element.
464      * 
465      * @param snapshotRepository
466      */
467     public void setSnapshotRepository( DeploymentRepository snapshotRepository )
468     {
469         this.snapshotRepository = snapshotRepository;
470     } //-- void setSnapshotRepository( DeploymentRepository )
471 
472     /**
473      * Set gives the status of this artifact in the remote
474      * repository.
475      *             This must not be set in your local project, as
476      * it is updated by
477      *             tools placing it in the reposiory. Valid values
478      * are: <code>none</code> (default),
479      *             <code>converted</code> (repository manager
480      * converted this from an Maven 1 POM),
481      *             <code>partner</code>
482      *             (directly synced from a partner Maven 2
483      * repository), <code>deployed</code> (was deployed from a
484      * Maven 2
485      *             instance), <code>verified</code> (has been hand
486      * verified as correct and final).
487      * 
488      * @param status
489      */
490     public void setStatus( String status )
491     {
492         this.status = status;
493     } //-- void setStatus( String )
494 
495 }