View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 2.1.2,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.model;
7   
8   /**
9    * Describes the prerequisites a project can have.
10   * 
11   * @version $Revision$ $Date$
12   */
13  @SuppressWarnings( "all" )
14  public class Prerequisites
15      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
16  {
17  
18        //--------------------------/
19       //- Class/Member Variables -/
20      //--------------------------/
21  
22      /**
23       * 
24       *             For a plugin project (packaging is
25       * <code>maven-plugin</code>), the minimum version of
26       *             Maven required to use the resulting plugin.<br>
27       *             In Maven 2, this was also specifying the minimum
28       * version of Maven required to build a
29       *             project, but this usage is <b>deprecated</b> in
30       * Maven 3 and not checked any more: use
31       *             the <a
32       * href="https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html">Maven
33       * Enforcer Plugin's
34       *             <code>requireMavenVersion</code> rule</a>
35       * instead.
36       *             
37       *           
38       */
39      private String maven = "2.0";
40  
41      /**
42       * Field locations.
43       */
44      private java.util.Map<Object, InputLocation> locations;
45  
46      /**
47       * Field location.
48       */
49      private InputLocation location;
50  
51      /**
52       * Field mavenLocation.
53       */
54      private InputLocation mavenLocation;
55  
56  
57        //-----------/
58       //- Methods -/
59      //-----------/
60  
61      /**
62       * Method clone.
63       * 
64       * @return Prerequisites
65       */
66      public Prerequisites clone()
67      {
68          try
69          {
70              Prerequisites copy = (Prerequisites) super.clone();
71  
72              if ( copy.locations != null )
73              {
74                  copy.locations = new java.util.LinkedHashMap( copy.locations );
75              }
76  
77              return copy;
78          }
79          catch ( java.lang.Exception ex )
80          {
81              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
82                  + " does not support clone()" ).initCause( ex );
83          }
84      } //-- Prerequisites clone()
85  
86      /**
87       * 
88       * 
89       * @param key a key object.
90       * @return InputLocation
91       */
92      public InputLocation getLocation( Object key )
93      {
94          if ( key instanceof String )
95          {
96              switch ( ( String ) key )
97              {
98                  case "" :
99                  {
100                     return this.location;
101                 }
102                 case "maven" :
103                 {
104                     return mavenLocation;
105                 }
106                 default :
107                 {
108                     return getOtherLocation( key );
109                 }
110                 }
111             }
112             else
113             {
114                 return getOtherLocation( key );
115             }
116     } //-- InputLocation getLocation( Object )
117 
118     /**
119      * Get for a plugin project (packaging is
120      * <code>maven-plugin</code>), the minimum version of
121      *             Maven required to use the resulting plugin.<br>
122      *             In Maven 2, this was also specifying the minimum
123      * version of Maven required to build a
124      *             project, but this usage is <b>deprecated</b> in
125      * Maven 3 and not checked any more: use
126      *             the <a
127      * href="https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html">Maven
128      * Enforcer Plugin's
129      *             <code>requireMavenVersion</code> rule</a>
130      * instead.
131      * 
132      * @return String
133      */
134     public String getMaven()
135     {
136         return this.maven;
137     } //-- String getMaven()
138 
139     /**
140      * 
141      * 
142      * @param key a key object.
143      * @param location a location object.
144      */
145     public void setLocation( Object key, InputLocation location )
146     {
147         if ( key instanceof String )
148         {
149             switch ( ( String ) key )
150             {
151                 case "" :
152                 {
153                     this.location = location;
154                     return;
155                 }
156                 case "maven" :
157                 {
158                     mavenLocation = location;
159                     return;
160                 }
161                 default :
162                 {
163                     setOtherLocation( key, location );
164                     return;
165                 }
166             }
167         }
168         else
169         {
170             setOtherLocation( key, location );
171         }
172     } //-- void setLocation( Object, InputLocation )
173 
174     /**
175      * 
176      * 
177      * @param key a key object.
178      * @param location a location object.
179      */
180     public void setOtherLocation( Object key, InputLocation location )
181     {
182         if ( location != null )
183         {
184             if ( this.locations == null )
185             {
186                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
187             }
188             this.locations.put( key, location );
189         }
190     } //-- void setOtherLocation( Object, InputLocation )
191 
192     /**
193      * 
194      * 
195      * @param key a key object.
196      * @return InputLocation
197      */
198     private InputLocation getOtherLocation( Object key )
199     {
200         return ( locations != null ) ? locations.get( key ) : null;
201     } //-- InputLocation getOtherLocation( Object )
202 
203     /**
204      * Set for a plugin project (packaging is
205      * <code>maven-plugin</code>), the minimum version of
206      *             Maven required to use the resulting plugin.<br>
207      *             In Maven 2, this was also specifying the minimum
208      * version of Maven required to build a
209      *             project, but this usage is <b>deprecated</b> in
210      * Maven 3 and not checked any more: use
211      *             the <a
212      * href="https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html">Maven
213      * Enforcer Plugin's
214      *             <code>requireMavenVersion</code> rule</a>
215      * instead.
216      * 
217      * @param maven a maven object.
218      */
219     public void setMaven( String maven )
220     {
221         this.maven = maven;
222     } //-- void setMaven( String )
223 
224 }