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 is the property specification used to activate a profile.
10   * If the value field
11   *         is empty, then the existence of the named property will
12   * activate the profile, otherwise it
13   *         does a case-sensitive match against the property value
14   * as well.
15   * 
16   * @version $Revision$ $Date$
17   */
18  @SuppressWarnings( "all" )
19  public class ActivationProperty
20      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
21  {
22  
23        //--------------------------/
24       //- Class/Member Variables -/
25      //--------------------------/
26  
27      /**
28       * The name of the property to be used to activate a profile.
29       */
30      private String name;
31  
32      /**
33       * The value of the property required to activate a profile.
34       */
35      private String value;
36  
37      /**
38       * Field locations.
39       */
40      private java.util.Map<Object, InputLocation> locations;
41  
42      /**
43       * Field location.
44       */
45      private InputLocation location;
46  
47      /**
48       * Field nameLocation.
49       */
50      private InputLocation nameLocation;
51  
52      /**
53       * Field valueLocation.
54       */
55      private InputLocation valueLocation;
56  
57  
58        //-----------/
59       //- Methods -/
60      //-----------/
61  
62      /**
63       * Method clone.
64       * 
65       * @return ActivationProperty
66       */
67      public ActivationProperty clone()
68      {
69          try
70          {
71              ActivationProperty copy = (ActivationProperty) super.clone();
72  
73              if ( copy.locations != null )
74              {
75                  copy.locations = new java.util.LinkedHashMap( copy.locations );
76              }
77  
78              return copy;
79          }
80          catch ( java.lang.Exception ex )
81          {
82              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
83                  + " does not support clone()" ).initCause( ex );
84          }
85      } //-- ActivationProperty clone()
86  
87      /**
88       * 
89       * 
90       * @param key
91       * @return InputLocation
92       */
93      public InputLocation getLocation( Object key )
94      {
95          if ( key instanceof String )
96          {
97              switch ( ( String ) key )
98              {
99                  case "" :
100                 {
101                     return this.location;
102                 }
103                 case "name" :
104                 {
105                     return nameLocation;
106                 }
107                 case "value" :
108                 {
109                     return valueLocation;
110                 }
111                 default :
112                 {
113                     return getOtherLocation( key );
114                 }
115                 }
116             }
117             else
118             {
119                 return getOtherLocation( key );
120             }
121     } //-- InputLocation getLocation( Object )
122 
123     /**
124      * Get the name of the property to be used to activate a
125      * profile.
126      * 
127      * @return String
128      */
129     public String getName()
130     {
131         return this.name;
132     } //-- String getName()
133 
134     /**
135      * 
136      * 
137      * @param key
138      * @param location
139      */
140     public void setLocation( Object key, InputLocation location )
141     {
142         if ( key instanceof String )
143         {
144             switch ( ( String ) key )
145             {
146                 case "" :
147                 {
148                     this.location = location;
149                     return;
150                 }
151                 case "name" :
152                 {
153                     nameLocation = location;
154                     return;
155                 }
156                 case "value" :
157                 {
158                     valueLocation = 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
178      * @param location
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
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      * Get the value of the property required to activate a
205      * profile.
206      * 
207      * @return String
208      */
209     public String getValue()
210     {
211         return this.value;
212     } //-- String getValue()
213 
214     /**
215      * Set the name of the property to be used to activate a
216      * profile.
217      * 
218      * @param name
219      */
220     public void setName( String name )
221     {
222         this.name = name;
223     } //-- void setName( String )
224 
225     /**
226      * Set the value of the property required to activate a
227      * profile.
228      * 
229      * @param value
230      */
231     public void setValue( String value )
232     {
233         this.value = value;
234     } //-- void setValue( String )
235 
236 }