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    * This is the file specification used to activate the profile. The
10   * <code>missing</code> value
11   *         is the location of a file that needs to exist, and if it
12   * doesn't, the profile will be
13   *         activated. On the other hand, <code>exists</code> will
14   * test for the existence of the file and if it is
15   *         there, the profile will be activated.<br>
16   *         Variable interpolation for these file specifications is
17   * limited to <code>${project.basedir}</code>,
18   *         system properties and user properties.
19   * 
20   * @version $Revision$ $Date$
21   */
22  @SuppressWarnings( "all" )
23  public class ActivationFile
24      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
25  {
26  
27        //--------------------------/
28       //- Class/Member Variables -/
29      //--------------------------/
30  
31      /**
32       * The name of the file that must be missing to activate the
33       *           profile.
34       */
35      private String missing;
36  
37      /**
38       * The name of the file that must exist to activate the profile.
39       */
40      private String exists;
41  
42      /**
43       * Field locations.
44       */
45      private java.util.Map<Object, InputLocation> locations;
46  
47      /**
48       * Field location.
49       */
50      private InputLocation location;
51  
52      /**
53       * Field missingLocation.
54       */
55      private InputLocation missingLocation;
56  
57      /**
58       * Field existsLocation.
59       */
60      private InputLocation existsLocation;
61  
62  
63        //-----------/
64       //- Methods -/
65      //-----------/
66  
67      /**
68       * Method clone.
69       * 
70       * @return ActivationFile
71       */
72      public ActivationFile clone()
73      {
74          try
75          {
76              ActivationFile copy = (ActivationFile) super.clone();
77  
78              if ( copy.locations != null )
79              {
80                  copy.locations = new java.util.LinkedHashMap( copy.locations );
81              }
82  
83              return copy;
84          }
85          catch ( java.lang.Exception ex )
86          {
87              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
88                  + " does not support clone()" ).initCause( ex );
89          }
90      } //-- ActivationFile clone()
91  
92      /**
93       * Get the name of the file that must exist to activate the
94       * profile.
95       * 
96       * @return String
97       */
98      public String getExists()
99      {
100         return this.exists;
101     } //-- String getExists()
102 
103     /**
104      * 
105      * 
106      * @param key a key object.
107      * @return InputLocation
108      */
109     public InputLocation getLocation( Object key )
110     {
111         if ( key instanceof String )
112         {
113             switch ( ( String ) key )
114             {
115                 case "" :
116                 {
117                     return this.location;
118                 }
119                 case "missing" :
120                 {
121                     return missingLocation;
122                 }
123                 case "exists" :
124                 {
125                     return existsLocation;
126                 }
127                 default :
128                 {
129                     return getOtherLocation( key );
130                 }
131                 }
132             }
133             else
134             {
135                 return getOtherLocation( key );
136             }
137     } //-- InputLocation getLocation( Object )
138 
139     /**
140      * Get the name of the file that must be missing to activate
141      * the
142      *           profile.
143      * 
144      * @return String
145      */
146     public String getMissing()
147     {
148         return this.missing;
149     } //-- String getMissing()
150 
151     /**
152      * 
153      * 
154      * @param key a key object.
155      * @param location a location object.
156      */
157     public void setLocation( Object key, InputLocation location )
158     {
159         if ( key instanceof String )
160         {
161             switch ( ( String ) key )
162             {
163                 case "" :
164                 {
165                     this.location = location;
166                     return;
167                 }
168                 case "missing" :
169                 {
170                     missingLocation = location;
171                     return;
172                 }
173                 case "exists" :
174                 {
175                     existsLocation = location;
176                     return;
177                 }
178                 default :
179                 {
180                     setOtherLocation( key, location );
181                     return;
182                 }
183             }
184         }
185         else
186         {
187             setOtherLocation( key, location );
188         }
189     } //-- void setLocation( Object, InputLocation )
190 
191     /**
192      * 
193      * 
194      * @param key a key object.
195      * @param location a location object.
196      */
197     public void setOtherLocation( Object key, InputLocation location )
198     {
199         if ( location != null )
200         {
201             if ( this.locations == null )
202             {
203                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
204             }
205             this.locations.put( key, location );
206         }
207     } //-- void setOtherLocation( Object, InputLocation )
208 
209     /**
210      * 
211      * 
212      * @param key a key object.
213      * @return InputLocation
214      */
215     private InputLocation getOtherLocation( Object key )
216     {
217         return ( locations != null ) ? locations.get( key ) : null;
218     } //-- InputLocation getOtherLocation( Object )
219 
220     /**
221      * Set the name of the file that must exist to activate the
222      * profile.
223      * 
224      * @param exists a exists object.
225      */
226     public void setExists( String exists )
227     {
228         this.exists = exists;
229     } //-- void setExists( String )
230 
231     /**
232      * Set the name of the file that must be missing to activate
233      * the
234      *           profile.
235      * 
236      * @param missing a missing object.
237      */
238     public void setMissing( String missing )
239     {
240         this.missing = missing;
241     } //-- void setMissing( String )
242 
243 }