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    * Describes the licenses for this project. This is used to
10   * generate the license
11   *         page of the project's web site, as well as being taken
12   * into consideration in other reporting
13   *         and validation. The licenses listed for the project are
14   * that of the project itself, and not
15   *         of dependencies.
16   * 
17   * @version $Revision$ $Date$
18   */
19  @SuppressWarnings( "all" )
20  public class License
21      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
22  {
23  
24        //--------------------------/
25       //- Class/Member Variables -/
26      //--------------------------/
27  
28      /**
29       * The full legal name of the license.
30       */
31      private String name;
32  
33      /**
34       * The official url for the license text.
35       */
36      private String url;
37  
38      /**
39       * 
40       *             
41       *             The primary method by which this project may be
42       * distributed.
43       *             <dl>
44       *               <dt>repo</dt>
45       *               <dd>may be downloaded from the Maven
46       * repository</dd>
47       *               <dt>manual</dt>
48       *               <dd>user must manually download and install
49       * the dependency.</dd>
50       *             </dl>
51       *             
52       *           
53       */
54      private String distribution;
55  
56      /**
57       * Addendum information pertaining to this license.
58       */
59      private String comments;
60  
61      /**
62       * Field locations.
63       */
64      private java.util.Map<Object, InputLocation> locations;
65  
66      /**
67       * Field location.
68       */
69      private InputLocation location;
70  
71      /**
72       * Field nameLocation.
73       */
74      private InputLocation nameLocation;
75  
76      /**
77       * Field urlLocation.
78       */
79      private InputLocation urlLocation;
80  
81      /**
82       * Field distributionLocation.
83       */
84      private InputLocation distributionLocation;
85  
86      /**
87       * Field commentsLocation.
88       */
89      private InputLocation commentsLocation;
90  
91  
92        //-----------/
93       //- Methods -/
94      //-----------/
95  
96      /**
97       * Method clone.
98       * 
99       * @return License
100      */
101     public License clone()
102     {
103         try
104         {
105             License copy = (License) super.clone();
106 
107             if ( copy.locations != null )
108             {
109                 copy.locations = new java.util.LinkedHashMap( copy.locations );
110             }
111 
112             return copy;
113         }
114         catch ( java.lang.Exception ex )
115         {
116             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
117                 + " does not support clone()" ).initCause( ex );
118         }
119     } //-- License clone()
120 
121     /**
122      * Get addendum information pertaining to this license.
123      * 
124      * @return String
125      */
126     public String getComments()
127     {
128         return this.comments;
129     } //-- String getComments()
130 
131     /**
132      * Get the primary method by which this project may be
133      * distributed.
134      *             <dl>
135      *               <dt>repo</dt>
136      *               <dd>may be downloaded from the Maven
137      * repository</dd>
138      *               <dt>manual</dt>
139      *               <dd>user must manually download and install
140      * the dependency.</dd>
141      *             </dl>
142      * 
143      * @return String
144      */
145     public String getDistribution()
146     {
147         return this.distribution;
148     } //-- String getDistribution()
149 
150     /**
151      * 
152      * 
153      * @param key
154      * @return InputLocation
155      */
156     public InputLocation getLocation( Object key )
157     {
158         if ( key instanceof String )
159         {
160             switch ( ( String ) key )
161             {
162                 case "" :
163                 {
164                     return this.location;
165                 }
166                 case "name" :
167                 {
168                     return nameLocation;
169                 }
170                 case "url" :
171                 {
172                     return urlLocation;
173                 }
174                 case "distribution" :
175                 {
176                     return distributionLocation;
177                 }
178                 case "comments" :
179                 {
180                     return commentsLocation;
181                 }
182                 default :
183                 {
184                     return getOtherLocation( key );
185                 }
186                 }
187             }
188             else
189             {
190                 return getOtherLocation( key );
191             }
192     } //-- InputLocation getLocation( Object )
193 
194     /**
195      * Get the full legal name of the license.
196      * 
197      * @return String
198      */
199     public String getName()
200     {
201         return this.name;
202     } //-- String getName()
203 
204     /**
205      * 
206      * 
207      * @param key
208      * @param location
209      */
210     public void setLocation( Object key, InputLocation location )
211     {
212         if ( key instanceof String )
213         {
214             switch ( ( String ) key )
215             {
216                 case "" :
217                 {
218                     this.location = location;
219                     return;
220                 }
221                 case "name" :
222                 {
223                     nameLocation = location;
224                     return;
225                 }
226                 case "url" :
227                 {
228                     urlLocation = location;
229                     return;
230                 }
231                 case "distribution" :
232                 {
233                     distributionLocation = location;
234                     return;
235                 }
236                 case "comments" :
237                 {
238                     commentsLocation = location;
239                     return;
240                 }
241                 default :
242                 {
243                     setOtherLocation( key, location );
244                     return;
245                 }
246                 }
247             }
248             else
249             {
250                 setOtherLocation( key, location );
251             }
252     } //-- void setLocation( Object, InputLocation )
253 
254     /**
255      * 
256      * 
257      * @param key
258      * @param location
259      */
260     public void setOtherLocation( Object key, InputLocation location )
261     {
262         if ( location != null )
263         {
264             if ( this.locations == null )
265             {
266                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
267             }
268             this.locations.put( key, location );
269         }
270     } //-- void setOtherLocation( Object, InputLocation )
271 
272     /**
273      * 
274      * 
275      * @param key
276      * @return InputLocation
277      */
278     private InputLocation getOtherLocation( Object key )
279     {
280         return ( locations != null ) ? locations.get( key ) : null;
281     } //-- InputLocation getOtherLocation( Object )
282 
283     /**
284      * Get the official url for the license text.
285      * 
286      * @return String
287      */
288     public String getUrl()
289     {
290         return this.url;
291     } //-- String getUrl()
292 
293     /**
294      * Set addendum information pertaining to this license.
295      * 
296      * @param comments
297      */
298     public void setComments( String comments )
299     {
300         this.comments = comments;
301     } //-- void setComments( String )
302 
303     /**
304      * Set the primary method by which this project may be
305      * distributed.
306      *             <dl>
307      *               <dt>repo</dt>
308      *               <dd>may be downloaded from the Maven
309      * repository</dd>
310      *               <dt>manual</dt>
311      *               <dd>user must manually download and install
312      * the dependency.</dd>
313      *             </dl>
314      * 
315      * @param distribution
316      */
317     public void setDistribution( String distribution )
318     {
319         this.distribution = distribution;
320     } //-- void setDistribution( String )
321 
322     /**
323      * Set the full legal name of the license.
324      * 
325      * @param name
326      */
327     public void setName( String name )
328     {
329         this.name = name;
330     } //-- void setName( String )
331 
332     /**
333      * Set the official url for the license text.
334      * 
335      * @param url
336      */
337     public void setUrl( String url )
338     {
339         this.url = url;
340     } //-- void setUrl( String )
341 
342     
343             
344     /**
345      * @see java.lang.Object#toString()
346      */
347     public String toString()
348     {
349         return "License {name=" + name + ", url=" + url + "}";
350     }
351             
352           
353 }