View Javadoc

1   /*
2    * $Id$
3    */
4   
5   package org.apache.maven.model;
6   
7     //---------------------------------/
8    //- Imported classes and packages -/
9   //---------------------------------/
10  
11  import java.util.Date;
12  
13  /**
14   * Describes the licenses for this project. This is used to
15   * generate the license
16   *         page of the project's web site, as well as being taken
17   * into consideration in other reporting
18   *         and validation. The licenses listed for the project are
19   * that of the project itself, and not
20   *         of dependencies.
21   * 
22   * @version $Revision$ $Date$
23   */
24  public class License implements java.io.Serializable {
25  
26  
27        //--------------------------/
28       //- Class/Member Variables -/
29      //--------------------------/
30  
31      /**
32       * The full legal name of the license.
33       */
34      private String name;
35  
36      /**
37       * The official url for the license text.
38       */
39      private String url;
40  
41      /**
42       * 
43       *             
44       *             The primary method by which this project may be
45       * distributed.
46       *             <dl>
47       *               <dt>repo</dt>
48       *               <dd>may be downloaded from the Maven
49       * repository</dd>
50       *               <dt>manual</dt>
51       *               <dd>user must manually download and install
52       * the dependency.</dd>
53       *             </dl>
54       *             
55       *           
56       */
57      private String distribution;
58  
59      /**
60       * Addendum information pertaining to this license.
61       */
62      private String comments;
63  
64  
65        //-----------/
66       //- Methods -/
67      //-----------/
68  
69      /**
70       * Get addendum information pertaining to this license.
71       * 
72       * @return String
73       */
74      public String getComments()
75      {
76          return this.comments;
77      } //-- String getComments() 
78  
79      /**
80       * Get 
81       *             
82       *             The primary method by which this project may be
83       * distributed.
84       *             <dl>
85       *               <dt>repo</dt>
86       *               <dd>may be downloaded from the Maven
87       * repository</dd>
88       *               <dt>manual</dt>
89       *               <dd>user must manually download and install
90       * the dependency.</dd>
91       *             </dl>
92       *             
93       *           
94       * 
95       * @return String
96       */
97      public String getDistribution()
98      {
99          return this.distribution;
100     } //-- String getDistribution() 
101 
102     /**
103      * Get the full legal name of the license.
104      * 
105      * @return String
106      */
107     public String getName()
108     {
109         return this.name;
110     } //-- String getName() 
111 
112     /**
113      * Get the official url for the license text.
114      * 
115      * @return String
116      */
117     public String getUrl()
118     {
119         return this.url;
120     } //-- String getUrl() 
121 
122     /**
123      * Set addendum information pertaining to this license.
124      * 
125      * @param comments
126      */
127     public void setComments( String comments )
128     {
129         this.comments = comments;
130     } //-- void setComments( String ) 
131 
132     /**
133      * Set 
134      *             
135      *             The primary method by which this project may be
136      * distributed.
137      *             <dl>
138      *               <dt>repo</dt>
139      *               <dd>may be downloaded from the Maven
140      * repository</dd>
141      *               <dt>manual</dt>
142      *               <dd>user must manually download and install
143      * the dependency.</dd>
144      *             </dl>
145      *             
146      *           
147      * 
148      * @param distribution
149      */
150     public void setDistribution( String distribution )
151     {
152         this.distribution = distribution;
153     } //-- void setDistribution( String ) 
154 
155     /**
156      * Set the full legal name of the license.
157      * 
158      * @param name
159      */
160     public void setName( String name )
161     {
162         this.name = name;
163     } //-- void setName( String ) 
164 
165     /**
166      * Set the official url for the license text.
167      * 
168      * @param url
169      */
170     public void setUrl( String url )
171     {
172         this.url = url;
173     } //-- void setUrl( String ) 
174 
175 
176     private String modelEncoding = "UTF-8";
177 
178     /**
179      * Set an encoding used for reading/writing the model.
180      *
181      * @param modelEncoding the encoding used when reading/writing the model.
182      */
183     public void setModelEncoding( String modelEncoding )
184     {
185         this.modelEncoding = modelEncoding;
186     }
187 
188     /**
189      * @return the current encoding used when reading/writing this model.
190      */
191     public String getModelEncoding()
192     {
193         return modelEncoding;
194     }
195 }